summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThien-Thi Nguyen <ttn@gnuvola.org>2005-08-09 07:36:12 +0000
committerThien-Thi Nguyen <ttn@gnuvola.org>2005-08-09 07:36:12 +0000
commitbbfe566a8c0d240e8a0e201985cbf27dbef1e871 (patch)
tree445ce47b1987fdaca579eb5c8a48502452f0cd24
parenta026388b167036c4b0783094c03c92cddc7ecc44 (diff)
downloademacs-bbfe566a8c0d240e8a0e201985cbf27dbef1e871.tar.gz
(Fexpt): Use floats for negative exponent.
-rw-r--r--src/floatfns.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/floatfns.c b/src/floatfns.c
index 57bece2708b..79574e0a69b 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -461,7 +461,8 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
CHECK_NUMBER_OR_FLOAT (arg1);
CHECK_NUMBER_OR_FLOAT (arg2);
if (INTEGERP (arg1) /* common lisp spec */
- && INTEGERP (arg2)) /* don't promote, if both are ints */
+ && INTEGERP (arg2) /* don't promote, if both are ints, and */
+ && 0 <= XINT (arg2)) /* we are sure the result is not fractional */
{ /* this can be improved by pre-calculating */
EMACS_INT acc, x, y; /* some binary powers of x then accumulating */
Lisp_Object val;