emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: expt weirdness in floatfns.c


From: Thien-Thi Nguyen
Subject: Re: expt weirdness in floatfns.c
Date: 06 Aug 2005 10:12:33 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

"D Goel" <address@hidden> writes:

> i think that both should return the proper values instead of
> truncated integers

i agree.  how does the following patch look?

thi


___________________________________
*** floatfns.c  4 Jul 2005 16:06:31 -0000       1.84
--- floatfns.c  6 Aug 2005 14:07:36 -0000
***************
*** 460,466 ****
    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 */
      {                         /* this can be improved by pre-calculating */
        EMACS_INT acc, x, y;    /* some binary powers of x then accumulating */
        Lisp_Object val;
--- 460,467 ----
    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, */
!       && 0 <= XINT (arg2)) /* or if we are taking the ARG2'th root */
      {                         /* this can be improved by pre-calculating */
        EMACS_INT acc, x, y;    /* some binary powers of x then accumulating */
        Lisp_Object val;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]