[PATCH] msvcrt: Fix the fallback implementation of asinh for large negative values
23 Apr
2019
23 Apr
'19
7 a.m.
Signed-off-by: Martin Storsjo <martin(a)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
2425
Age (days ago)
2427
Last active (days ago)
1 comments
2 participants
participants (2)
-
Martin Storsjo -
Piotr Caban