Fix bugs in expt and integer-expt
* libguile/numbers.c (scm_expt): Fix bug that caused expt to throw an
exception whenever the base was exact and the exponent was an
inexact integer, e.g. (expt 5 6.0).
(scm_expt): Fix bug that caused expt to introduce spurious imaginary
parts in the result when the base was an inexact negative real and
the exponent was an integer, e.g. (expt -1.0 2)
(scm_integer_expt, scm_expt): Change behavior of (integer-expt 0 -1),
and therefore also (expt 0 -1), to return NaN, per R6RS (actually,
R6RS says we should throw an exception or return an "unspecified
number object", but for now we use NaN). Formerly we returned 0, per
R5RS. R5RS claims that 0^x=0 for all non-zero x, but that's
mathematically incorrect, and probably an oversight.
(scm_integer_expt): Consistently throw a wrong-argument-type exception
when the exponent is inexact. Formerly, it didn't always check this
if the base was 0, 1, or -1.
* test-suite/tests/numbers.test ("integer-expt", "expt"): Add tests.