From 3aa5583cab35f94dc6847c01b4e9838e1969faa9 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 1 Sep 2014 13:51:58 +0200 Subject: [PATCH] fix asinh() on win64 for big negative values --- ext/standard/math.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 } /* }}} */ -- 2.50.1