Function: math-mod-fancy

math-mod-fancy is an autoloaded and byte-compiled function defined in calc-arith.el.gz.

Signature

(math-mod-fancy A B)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-arith.el.gz
(defun math-mod-fancy (a b)
  (cond ((equal b '(var inf var-inf))
	 (if (or (math-posp a) (math-zerop a))
	     a
	   (if (math-negp a)
	       b
	     (if (eq (car-safe a) 'intv)
		 (if (math-negp (nth 2 a))
		     '(intv 3 0 (var inf var-inf))
		   a)
	       (list '% a b)))))
	((and (eq (car-safe a) 'mod) (Math-realp b) (math-posp b))
	 (math-make-mod (nth 1 a) b))
	((and (eq (car-safe a) 'intv) (math-intv-constp a t) (math-posp b))
	 (math-mod-intv a b))
	(t
	 (if (Math-anglep a)
	     (calc-record-why 'anglep b)
	   (calc-record-why 'anglep a))
	 (list '% a b))))