From 68df8ea4655c97f83ce7d194b9a7f2c9db006e7f Mon Sep 17 00:00:00 2001 From: Jeroen van Wolffelaar Date: Sat, 4 Aug 2001 20:58:47 +0000 Subject: [PATCH] Another bugfix in pow. Special cases, with 10 times the same thing are _so_ error_prone... :( --- ext/standard/math.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */ -- 2.50.1