Function: math-pow-of-zero
math-pow-of-zero is an autoloaded and byte-compiled function defined
in calc-arith.el.gz.
Signature
(math-pow-of-zero A B)
Documentation
Raise A to the power of B, where A is a form of zero.
Source Code
;; Defined in /usr/src/emacs/lisp/calc/calc-arith.el.gz
(defun math-pow-of-zero (a b)
"Raise A to the power of B, where A is a form of zero."
(if (math-floatp b) (setq a (math-float a)))
(cond
;; 0^0 = 1
((eq b 0)
1)
;; 0^0.0, etc., are undetermined
((Math-zerop b)
(if calc-infinite-mode
'(var nan var-nan)
(math-reject-arg (list '^ a b) "*Indeterminate form")))
;; 0^positive = 0
((math-known-posp b)
a)
;; 0^negative is undefined (let math-div handle it)
((math-known-negp b)
(math-div 1 a))
;; 0^infinity is undefined
((math-infinitep b)
'(var nan var-nan))
;; Some intervals
((and (eq (car b) 'intv)
calc-infinite-mode
(math-negp (nth 2 b))
(math-posp (nth 3 b)))
'(intv 3 (neg (var inf var-inf)) (var inf var-inf)))
;; If none of the above, leave it alone.
(t
(list '^ a b))))