summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Wolffelaar <jeroen@php.net>2001-08-04 20:58:47 +0000
committerJeroen van Wolffelaar <jeroen@php.net>2001-08-04 20:58:47 +0000
commit68df8ea4655c97f83ce7d194b9a7f2c9db006e7f (patch)
treede79f768b54f699f36aadf20764d85d884071609
parent7d5999fb4db0068f8a28b3c391703fcbd3bb3787 (diff)
downloadphp-git-68df8ea4655c97f83ce7d194b9a7f2c9db006e7f.tar.gz
Another bugfix in pow. Special cases, with 10 times the same thing are
_so_ error_prone... :(
-rw-r--r--ext/standard/math.c3
1 files changed, 2 insertions, 1 deletions
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 */