From: Jeroen van Wolffelaar Date: Sat, 4 Aug 2001 20:58:47 +0000 (+0000) Subject: Another bugfix in pow. Special cases, with 10 times the same thing are X-Git-Tag: PRE_ENGINE2_SPLIT~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68df8ea4655c97f83ce7d194b9a7f2c9db006e7f;p=php Another bugfix in pow. Special cases, with 10 times the same thing are _so_ error_prone... :( --- diff --git a/ext/standard/math.c b/ext/standard/math.c index 720a1fa3a3..b0676fdaa9 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -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 */