summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */