Skip to content

Commit 1b90e9c

Browse files
authored
Apply suggestions from code review
1 parent d331240 commit 1b90e9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/mathmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,15 +2164,15 @@ math_ldexp_impl(PyObject *module, double x, PyObject *i)
21642164
errno = 0;
21652165
r = ldexp(x, (int)exp);
21662166
#if _MSC_VER
2167-
if (r && r > -DBL_MIN && r < DBL_MIN) {
2167+
if (-DBL_MIN < r && r < DBL_MIN) {
21682168
/* Denormal result can be incorrectly rounded here (rather,
21692169
truncated). Fixed in newer versions of the C runtime, included
21702170
with Windows 11. */
21712171
int original_exp;
21722172
frexp(x, &original_exp);
21732173
if (original_exp > DBL_MIN_EXP) {
21742174
/* Shift down to the smallest normal binade. No bits lost. */
2175-
int shift = DBL_MIN_EXP - original_exp
2175+
int shift = DBL_MIN_EXP - original_exp;
21762176
x = ldexp(x, shift);
21772177
exp -= shift;
21782178
}

0 commit comments

Comments
 (0)