* libguile/numbers.c (scm_expt): Fix check regarding when to dispatch to
integer-expt.
* test-suite/tests/numbers.test ("expt"): Add test.
"Return @var{x} raised to the power of @var{y}.")
#define FUNC_NAME s_scm_expt
{
- if (!SCM_INEXACTP (y) && scm_is_integer (y))
+ if ((SCM_I_INUMP (x) || SCM_BIGP (x)) && scm_is_integer (y))
return scm_integer_expt (x, y);
else if (scm_is_real (x) && scm_is_real (y) && scm_to_double (x) >= 0.0)
{
;;;
(with-test-prefix "expt"
+ (pass-if-exception "non-numeric base" exception:wrong-type-arg
+ (expt #t 0))
(pass-if "(= 1 (expt 0 0))" (= 1 (expt 0 0)))
(pass-if "(= 1 (expt 0 0.0))" (= 1 (expt 0 0.0)))
(pass-if "(= 1 (expt 0.0 0))" (= 1 (expt 0.0 0)))