Mercurial > emacs
diff src/floatfns.c @ 91041:bdb3fe0ba9fa
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 866-879)
- Merge multi-tty branch
- Update from CVS
- Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-257
| author | Miles Bader <miles@gnu.org> |
|---|---|
| date | Thu, 11 Oct 2007 16:22:07 +0000 |
| parents | f55f9811f5d7 259a9fdd1450 |
| children | 606f2d163a64 |
line wrap: on
line diff
--- a/src/floatfns.c Thu Oct 11 16:14:00 2007 +0000 +++ b/src/floatfns.c Thu Oct 11 16:22:07 2007 +0000 @@ -454,7 +454,7 @@ (arg1, arg2) register Lisp_Object arg1, arg2; { - double f1, f2; + double f1, f2, f3; CHECK_NUMBER_OR_FLOAT (arg1); CHECK_NUMBER_OR_FLOAT (arg2); @@ -500,8 +500,11 @@ else if ((f1 == 0.0 && f2 < 0.0) || (f1 < 0 && f2 != floor(f2))) domain_error2 ("expt", arg1, arg2); #endif - IN_FLOAT2 (f1 = pow (f1, f2), "expt", arg1, arg2); - return make_float (f1); + IN_FLOAT2 (f3 = pow (f1, f2), "expt", arg1, arg2); + /* Check for overflow in the result. */ + if (f1 != 0.0 && f3 == 0.0) + range_error ("expt", arg1); + return make_float (f3); } DEFUN ("log", Flog, Slog, 1, 2, 0,
