Function: math-squared-factor

math-squared-factor is a byte-compiled function defined in calc-alg.el.gz.

Signature

(math-squared-factor X)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-alg.el.gz
;;; Rather than factoring x into primes, just check for the first ten primes.
(defun math-squared-factor (x)
  (if (Math-integerp x)
      (let ((prsqr '(4 9 25 49 121 169 289 361 529 841))
	    (fac 1)
	    res)
	(while prsqr
	  (if (eq (cdr (setq res (math-idivmod x (car prsqr)))) 0)
	      (setq x (car res)
		    fac (math-mul fac (car prsqr)))
	    (setq prsqr (cdr prsqr))))
	fac)))