Function: math-poly-degree

math-poly-degree is an autoloaded and byte-compiled function defined in calc-poly.el.gz.

Signature

(math-poly-degree EXPR)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-poly.el.gz
(defun math-poly-degree (expr)
  (cond ((Math-primp expr)
	 (if (eq (car-safe expr) 'var) 1 0))
	((eq (car expr) 'neg)
	 (math-poly-degree (nth 1 expr)))
	((eq (car expr) '*)
	 (+ (math-poly-degree (nth 1 expr))
	    (math-poly-degree (nth 2 expr))))
	((eq (car expr) '/)
	 (- (math-poly-degree (nth 1 expr))
	    (math-poly-degree (nth 2 expr))))
	((and (eq (car expr) '^) (natnump (nth 2 expr)))
	 (* (math-poly-degree (nth 1 expr)) (nth 2 expr)))
	((memq (car expr) '(+ -))
	 (max (math-poly-degree (nth 1 expr))
	      (math-poly-degree (nth 2 expr))))
	(t 1)))