summaryrefslogtreecommitdiff
path: root/ext/standard/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r--ext/standard/math.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 83145a4dc9..7a3d9b6621 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -25,6 +25,7 @@
#include "php_math.h"
#include "zend_multiply.h"
#include "zend_exceptions.h"
+#include "zend_portability.h"
#include <math.h>
#include <float.h>
@@ -239,7 +240,7 @@ static double php_acosh(double x)
if (x >= 1) {
return log(x + sqrt(x * x - 1));
} else {
- return (DBL_MAX+DBL_MAX)-(DBL_MAX+DBL_MAX);
+ return ZEND_NAN;
}
# else
return(log(x + sqrt(x * x - 1)));
@@ -707,7 +708,7 @@ PHP_FUNCTION(log)
}
if (base == 1.0) {
- RETURN_DOUBLE(php_get_nan());
+ RETURN_DOUBLE(ZEND_NAN);
}
if (base <= 0.0) {
@@ -951,7 +952,7 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base)
char buf[(sizeof(double) << 3) + 1];
/* Don't try to convert +/- infinity */
- if (fvalue == HUGE_VAL || fvalue == -HUGE_VAL) {
+ if (fvalue == ZEND_INFINITY || fvalue == -ZEND_INFINITY) {
php_error_docref(NULL, E_WARNING, "Number too large");
return ZSTR_EMPTY_ALLOC();
}