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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index a1dda23eda..665822c035 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -219,7 +219,16 @@ static double php_asinh(double z)
#ifdef HAVE_ASINH
return(asinh(z));
#else
+# ifdef _WIN64
+ if (z > 0) {
+ return log(z + sqrt(z * z + 1));
+ }
+ else {
+ return -log(-z + sqrt(z * z + 1));
+ }
+# else
return(log(z + sqrt(1 + pow(z, 2))) / log(M_E));
+# endif
#endif
}
/* }}} */