(Fexpt): Use floats for negative exponent.
authorThien-Thi Nguyen <ttn@gnuvola.org>
Tue, 9 Aug 2005 07:37:25 +0000 (07:37 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Tue, 9 Aug 2005 07:37:25 +0000 (07:37 +0000)
src/ChangeLog
src/floatfns.c

index a35daab..256b720 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-09  Thien-Thi Nguyen  <ttn@gnu.org>
+
+       * floatfns.c (Fexpt): Use floats for negative exponent.
+
 2005-08-08  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
 
        * gtkutil.c (xg_modify_menubar_widgets): Remove semicolon that
index 57bece2..79574e0 100644 (file)
@@ -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;