Mercurial > emacs
comparison src/floatfns.c @ 4529:8dc73bbe1c46
(Fexpt): Use IN_FLOAT2.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Tue, 10 Aug 1993 05:47:49 +0000 |
| parents | 6131dad14f6f |
| children | e8bd41ac77be |
comparison
equal
deleted
inserted
replaced
| 4528:5622149e7f75 | 4529:8dc73bbe1c46 |
|---|---|
| 400 { | 400 { |
| 401 double f1, f2; | 401 double f1, f2; |
| 402 | 402 |
| 403 CHECK_NUMBER_OR_FLOAT (arg1, 0); | 403 CHECK_NUMBER_OR_FLOAT (arg1, 0); |
| 404 CHECK_NUMBER_OR_FLOAT (arg2, 0); | 404 CHECK_NUMBER_OR_FLOAT (arg2, 0); |
| 405 if ((XTYPE (arg1) == Lisp_Int) && /* common lisp spec */ | 405 if (XTYPE (arg1) == Lisp_Int /* common lisp spec */ |
| 406 (XTYPE (arg2) == Lisp_Int)) /* don't promote, if both are ints */ | 406 && XTYPE (arg2) == Lisp_Int) /* don't promote, if both are ints */ |
| 407 { /* this can be improved by pre-calculating */ | 407 { /* this can be improved by pre-calculating */ |
| 408 int acc, x, y; /* some binary powers of x then accumulating */ | 408 int acc, x, y; /* some binary powers of x then accumulating */ |
| 409 Lisp_Object val; | 409 Lisp_Object val; |
| 410 | 410 |
| 411 x = XINT (arg1); | 411 x = XINT (arg1); |
| 442 f1 = 1.0; | 442 f1 = 1.0; |
| 443 #ifdef FLOAT_CHECK_DOMAIN | 443 #ifdef FLOAT_CHECK_DOMAIN |
| 444 else if ((f1 == 0.0 && f2 < 0.0) || (f1 < 0 && f2 != floor(f2))) | 444 else if ((f1 == 0.0 && f2 < 0.0) || (f1 < 0 && f2 != floor(f2))) |
| 445 domain_error2 ("expt", arg1, arg2); | 445 domain_error2 ("expt", arg1, arg2); |
| 446 #endif | 446 #endif |
| 447 IN_FLOAT (f1 = pow (f1, f2), "expt", arg1); | 447 IN_FLOAT2 (f1 = pow (f1, f2), "expt", arg1, arg2); |
| 448 return make_float (f1); | 448 return make_float (f1); |
| 449 } | 449 } |
| 450 | 450 |
| 451 DEFUN ("log", Flog, Slog, 1, 2, 0, | 451 DEFUN ("log", Flog, Slog, 1, 2, 0, |
| 452 "Return the natural logarithm of ARG.\n\ | 452 "Return the natural logarithm of ARG.\n\ |
