Thanks for this explanation. Now I understand the behavior of EXPT in CLISP and Lispworks, and I will modify the patch for SBCL accordingly.


2010/4/30 Harald Hanche-Olsen <>
It seems to me that the hyperspec is quite specific about
(expt 0.0 0):

 When power-number is an integer 0, then the result is always the
 value one in the type of base-number, even if the base-number is
 zero (of any type). That is:

  (expt x 0) ==  (coerce 1 (type-of x))

You can't possibly get any clearer than that.

And it continues:

 If power-number is a zero of any other type, then the result is also
 the value one, in the type of the arguments after the application of
 the contagion rules in Section (Contagion in Numeric
 Operations), with one exception: the consequences are undefined if
 base-number is zero when power-number is zero and not of type

In other words, the consequences of (expt ZERO 0.0) are undefined if
ZERO is a zero of any type.

- Harald

Sbcl-devel mailing list