comparison src/floatfns.c @ 64810:3529fe766935

(Fexpt): Use floats for negative exponent.
author Thien-Thi Nguyen <ttn@gnuvola.org>
date Tue, 09 Aug 2005 07:36:12 +0000
parents 6de0f61d4874
children 199bdb85a35f 2d92f5c9d6ae
comparison
equal deleted inserted replaced
64809:b3d25b6347f2 64810:3529fe766935
459 double f1, f2; 459 double f1, f2;
460 460
461 CHECK_NUMBER_OR_FLOAT (arg1); 461 CHECK_NUMBER_OR_FLOAT (arg1);
462 CHECK_NUMBER_OR_FLOAT (arg2); 462 CHECK_NUMBER_OR_FLOAT (arg2);
463 if (INTEGERP (arg1) /* common lisp spec */ 463 if (INTEGERP (arg1) /* common lisp spec */
464 && INTEGERP (arg2)) /* don't promote, if both are ints */ 464 && INTEGERP (arg2) /* don't promote, if both are ints, and */
465 && 0 <= XINT (arg2)) /* we are sure the result is not fractional */
465 { /* this can be improved by pre-calculating */ 466 { /* this can be improved by pre-calculating */
466 EMACS_INT acc, x, y; /* some binary powers of x then accumulating */ 467 EMACS_INT acc, x, y; /* some binary powers of x then accumulating */
467 Lisp_Object val; 468 Lisp_Object val;
468 469
469 x = XINT (arg1); 470 x = XINT (arg1);