From 5a9807a8bda5980633db765300dad40ee3aed2c6 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 9 Aug 2005 07:37:25 +0000 Subject: [PATCH] (Fexpt): Use floats for negative exponent. --- src/ChangeLog | 4 ++++ src/floatfns.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index a35daab6728..256b720eace 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-08-09 Thien-Thi Nguyen + + * floatfns.c (Fexpt): Use floats for negative exponent. + 2005-08-08 Jan Dj,Ad(Brv * gtkutil.c (xg_modify_menubar_widgets): Remove semicolon that 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; -- 2.39.2