8000 gh-132876: workaround broken ldexp() on Windows 10 by skirpichev · Pull Request #133135 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-132876: workaround broken ldexp() on Windows 10 #133135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 26, 2025
Prev Previous commit
Next Next commit
Update Modules/mathmodule.c
  • Loading branch information
skirpichev authored Apr 29, 2025
commit d3312402db16ded2a49b45b72baa74759739699b
5 changes: 3 additions & 2 deletions Modules/mathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,8 +2172,9 @@
frexp(x, &original_exp);
if (original_exp > DBL_MIN_EXP) {
/* Shift down to the smallest normal binade. No bits lost. */
x = ldexp(x, DBL_MIN_EXP - original_exp);
exp += original_exp - DBL_MIN_EXP;
int shift = DBL_MIN_EXP - original_exp
x = ldexp(x, shift);

Check failure on line 2176 in Modules/mathmodule.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64)

syntax error: missing ';' before identifier 'x' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 2176 in Modules/mathmodule.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64)

syntax error: missing ';' before identifier 'x' [C:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 2176 in Modules/mathmodule.c

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64)

syntax error: missing ';' before identifier 'x' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Check failure on line 2176 in Modules/mathmodule.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64)

syntax error: missing ';' before identifier 'x' [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
exp -= shift;
}
/* Multiplying by 2**exp finishes the job, and the HW will round as
appropriate. Note: if exp < -DBL_MANT_DIG, all of x is shifted
Expand Down
Loading
0