Function: math-poly-div-base
math-poly-div-base is a byte-compiled function defined in
calc-poly.el.gz.
Signature
(math-poly-div-base A B)
Documentation
Find a suitable base for dividing a by b.
The base must exist in both expressions. The degree in the numerator must be higher or equal than the degree in the denominator. If the above conditions are not met the quotient is just a remainder. Return nil if this is the case.
Source Code
;; Defined in /usr/src/emacs/lisp/calc/calc-poly.el.gz
(defun math-poly-div-base (a b)
"Find a suitable base for dividing a by b.
The base must exist in both expressions.
The degree in the numerator must be higher or equal than the
degree in the denominator.
If the above conditions are not met the quotient is just a remainder.
Return nil if this is the case."
(let (a-base b-base)
(and (setq a-base (math-total-polynomial-base a))
(setq b-base (math-total-polynomial-base b))
(catch 'return
(while a-base
(let ((maybe (assoc (car (car a-base)) b-base)))
(if maybe
(if (>= (nth 1 (car a-base)) (nth 1 maybe))
(throw 'return (car (car a-base))))))
(setq a-base (cdr a-base)))))))