diff options
author | Jeroen van Wolffelaar <jeroen@php.net> | 2001-08-04 20:58:47 +0000 |
---|---|---|
committer | Jeroen van Wolffelaar <jeroen@php.net> | 2001-08-04 20:58:47 +0000 |
commit | 68df8ea4655c97f83ce7d194b9a7f2c9db006e7f (patch) | |
tree | de79f768b54f699f36aadf20764d85d884071609 | |
parent | 7d5999fb4db0068f8a28b3c391703fcbd3bb3787 (diff) | |
download | php-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.c | 3 |
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 */ |