Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/msvcrt/math.c | 2 +- dlls/ucrtbase/tests/misc.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 8d5b687b6f..a1ba552632 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -1015,7 +1015,7 @@ double CDECL MSVCRT_ldexp(double num, MSVCRT_long exp)
if (isfinite(num) && !isfinite(z)) math_error(_OVERFLOW, "ldexp", num, exp, z); - else if (isfinite(num) && !z) + else if (num && isfinite(num) && !z) math_error(_UNDERFLOW, "ldexp", num, exp, z); else if (z == 0 && signbit(z)) z = 0.0; /* Convert -0 -> +0 */ diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 2a9648ab6e..bd8034e994 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -694,11 +694,13 @@ static void test_math_errors(void) } testsdl[] = { {"_scalb", -INFINITY, 1, -1, -1}, {"_scalb", -1e100, 1, -1, -1}, + {"_scalb", 0, 1, -1, -1}, {"_scalb", 1e100, 1, -1, -1}, {"_scalb", INFINITY, 1, -1, -1}, {"_scalb", 1, 1e9, ERANGE, _OVERFLOW}, {"ldexp", -INFINITY, 1, -1, -1}, {"ldexp", -1e100, 1, -1, -1}, + {"ldexp", 0, 1, -1, -1}, {"ldexp", 1e100, 1, -1, -1}, {"ldexp", INFINITY, 1, -1, -1}, {"ldexp", 1, -1e9, -1, _UNDERFLOW},
Signed-off-by: piotr@codeweavers.com