Function: math-powerexpand
math-powerexpand is a byte-compiled function defined in
calc-alg.el.gz.
Signature
(math-powerexpand EXPR)
Source Code
;; Defined in /usr/src/emacs/lisp/calc/calc-alg.el.gz
(defun math-powerexpand (expr)
(if (eq (car-safe expr) '^)
(let ((n (nth 2 expr)))
(cond ((and (integerp n)
(> n 0))
(let ((i 1)
(a (nth 1 expr))
(prod (nth 1 expr)))
(while (< i n)
(setq prod (math-mul prod a))
(setq i (1+ i)))
prod))
((and (integerp n)
(< n 0))
(let ((i -1)
(a (math-pow (nth 1 expr) -1))
(prod (math-pow (nth 1 expr) -1)))
(while (> i n)
(setq prod (math-mul a prod))
(setq i (1- i)))
prod))
(t
expr)))
expr))