From cac87e302e52bae078f22a786ca3d9e2407683c4 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sat, 6 Aug 2005 18:27:09 +0000 Subject: [PATCH] (Fexpt): Use floats for negative exponent. --- src/ChangeLog | 5 +++++ src/floatfns.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6d8608dde22..9ff58e7f5a8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-08-06 Thien-Thi Nguyen + + * floatfns.c (Fexpt): Use floats for negative + exponent (computing a root). Reported by D Goel. + 2005-08-02 Richard M. Stallman * frame.c (Fframe_char_width): Doc fix. diff --git a/src/floatfns.c b/src/floatfns.c index 529e7b76e39..cbcc0bfe520 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -460,7 +460,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 not computing the -ARG2 root */ { /* this can be improved by pre-calculating */ EMACS_INT acc, x, y; /* some binary powers of x then accumulating */ Lisp_Object val; -- 2.39.5