Module: wine Branch: master Commit: 11166aa01e7d17f8535977f648c0b5e098d43bd9 URL: https://source.winehq.org/git/wine.git/?a=commit;h=11166aa01e7d17f8535977f64...
Author: Martin Storsjo martin@martin.st Date: Wed Jul 28 14:42:14 2021 +0200
msvcrt: Make the sinh function NAN preserving.
Signed-off-by: Martin Storsjo martin@martin.st Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msvcrt/math.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 2bd4206359b..a2b03110cf0 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -4046,6 +4046,7 @@ double CDECL sin( double x ) double CDECL sinh( double x ) { UINT64 ux = *(UINT64*)&x; + UINT64 sign = ux & 0x8000000000000000ULL; UINT32 w; double t, h, absx;
@@ -4070,7 +4071,10 @@ double CDECL sinh( double x )
/* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ - t = __expo2(absx, 2 * h); + if (ux > 0x7ff0000000000000ULL) + *(UINT64*)&t = ux | sign | 0x0008000000000000ULL; + else + t = __expo2(absx, 2 * h); return t; }