[PATCH] msvcrt: Fix the fallback implementation of asinh for large negative values

Martin Storsjo martin at martin.st
Tue Apr 23 02:00:04 CDT 2019


Signed-off-by: Martin Storsjo <martin at martin.st>
---
 dlls/msvcrt/math.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index c893c83a69..21f1f9b9b2 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -3063,7 +3063,10 @@ double CDECL MSVCR120_asinh(double x)
 #ifdef HAVE_ASINH
     return asinh(x);
 #else
-    if (!isfinite(x*x+1)) return log(2) + log(x);
+    if (!isfinite(x*x+1)) {
+      if (x > 0) return log(2) + log(x);
+      else return -log(2) - log(-x);
+    }
     return log(x + sqrt(x*x+1));
 #endif
 }
-- 
2.17.1




More information about the wine-devel mailing list