]> granicus.if.org Git - php/commitdiff
fix asinh() on win64 for big negative values
authorAnatol Belski <ab@php.net>
Mon, 1 Sep 2014 11:51:58 +0000 (13:51 +0200)
committerAnatol Belski <ab@php.net>
Mon, 1 Sep 2014 13:34:40 +0000 (15:34 +0200)
ext/standard/math.c

index a1dda23edac6393276df12331c47834a51ed86df..665822c0354b5d10e03f52f26ca3a24c4fbf31ee 100644 (file)
@@ -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
 }
 /* }}} */