expt
(expt base power)
Returns base raised to power. With integer arguments the result is an exact integer ((expt 2 10) is 1024), and a negative integer power gives the reciprocal ((expt 2 -1) is 1/2); if either argument is a float -- or the power is a ratio -- the result is a float, and a fractional power ((expt 2 0.5), (expt 10000.0 0.75)) works on every backend. The dispatch is on the run-time values, so a power computed at run time behaves like a literal one. A float or fractional power is fdlibm's pow on every backend (Math Function Backends), so the digits agree everywhere. A NEGATIVE base to a non-integer power leaves the real line and answers the plane instead of NaN: (expt -8 1/3) is #C(1.0000000000000002 1.7320508075688772), the modulus |base|^power turned through power * pi radians. An integer power -- including an integer-valued float like 2.0 -- stays real whatever the base's sign, so (expt -8.0 2.0) is 64.0. An exact zero to a negative integer power signals division-by-zero ((expt 0 -1)); a float result follows IEEE 754, so (expt 0 -1.5), (expt 0 -1/2) and (expt 0.0 -1) are infinities. A complex base to a rational power is the modulus |base|^power turned through power * (phase base) radians, as in SBCL, so a -0.0 part survives: (expt #c(0.0 -0.0) 2) is #C(0.0 -0.0) and (expt #c(1.5 -0.0) 3) is #C(3.375 -0.0); an exact complex to an integer power stays exact ((expt #c(1 2) 3) is #C(-11 -2)), and any zero power answers #C(1.0 0.0). A zero base to a float or complex power is zero when the power's real part is positive (exact 0 when both arguments are exact, #C(0.0 0.0) otherwise); any other such power has no value and answers IEEE's #C(NaN NaN). Works on all four backends.