]> granicus.if.org Git - php/commitdiff
Another bugfix in pow. Special cases, with 10 times the same thing are
authorJeroen van Wolffelaar <jeroen@php.net>
Sat, 4 Aug 2001 20:58:47 +0000 (20:58 +0000)
committerJeroen van Wolffelaar <jeroen@php.net>
Sat, 4 Aug 2001 20:58:47 +0000 (20:58 +0000)
_so_ error_prone... :(

ext/standard/math.c

index 720a1fa3a3e4dc278154cdf4ae96609552235f55..b0676fdaa94cf3d2dee33a7e40fd7036ee8c51aa 100644 (file)
@@ -470,7 +470,8 @@ PHP_FUNCTION(pow)
                        if (lexp == 1) {
                                RETURN_LONG(LONG_MIN);
                        } else {
-                               RETURN_DOUBLE(exp(log(-(double)LONG_MIN) * (double)lexp));
+                               dval = exp(log(-(double)LONG_MIN) * (double)lexp);
+                               RETURN_DOUBLE(lexp&1 ? -dval : dval);
                        }
                default:
                        /* abs(lbase) > 1 */