Function: math-commutative-equal

math-commutative-equal is a byte-compiled function defined in calc-arith.el.gz.

Signature

(math-commutative-equal A B)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-arith.el.gz
(defun math-commutative-equal (a b)
  (if (memq (car-safe a) '(+ -))
      (and (memq (car-safe b) '(+ -))
	   (let ((math-com-bterms nil) aterms p)
	     (math-commutative-collect b nil)
	     (setq aterms math-com-bterms math-com-bterms nil)
	     (math-commutative-collect a nil)
	     (and (= (length aterms) (length math-com-bterms))
		  (progn
		    (while (and aterms
				(progn
				  (setq p math-com-bterms)
				  (while (and p (not (equal (car aterms)
							    (car p))))
				    (setq p (cdr p)))
				  p))
		      (setq math-com-bterms (delq (car p) math-com-bterms)
			    aterms (cdr aterms)))
		    (not aterms)))))
    (equal a b)))