]> granicus.if.org Git - php/commitdiff
fix acosh for vs2012 and earlier
authorAnatol Belski <ab@php.net>
Mon, 1 Sep 2014 13:33:40 +0000 (15:33 +0200)
committerAnatol Belski <ab@php.net>
Mon, 1 Sep 2014 13:34:42 +0000 (15:34 +0200)
ext/standard/math.c

index 665822c0354b5d10e03f52f26ca3a24c4fbf31ee..c957ca4698717fcf352e3ba5ccf4a89e9f015759 100644 (file)
@@ -240,7 +240,15 @@ static double php_acosh(double x)
 #ifdef HAVE_ACOSH
        return(acosh(x));
 #else
+# ifdef _WIN64
+       if (x >= 1) {
+               return log(x + sqrt(x * x - 1));
+       } else {
+               return (DBL_MAX+DBL_MAX)-(DBL_MAX+DBL_MAX);
+       }
+# else
        return(log(x + sqrt(x * x - 1)));
+# endif
 #endif
 }
 /* }}} */