Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Co-authored-by: Tim Peters <tim.peters@gmail.com>
Some benchmarking in:#132876 (comment) |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Since this is a potentially breaking change on Windows, it really needs a NEWS entry, yes? Like
math.ldexp() on Windows failed to round subnormal results before Window 11, and Microsoft probably won't fix it for Windows 10. So Python works around the error on Windows now. This may change results (which were formerly erroneous) in rare cases.
And maybe link to the issue report?
It has a NEWS entry, though it could include a bit more detail (such as the ranges of values that may be incorrect). And that entry will already be linked to the bug. So this change LGTM |
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2025-04-29-11-48-46.gh-issue-132876.lyTQGZ.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2025-04-29-11-48-46.gh-issue-132876.lyTQGZ.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2025-04-29-11-48-46.gh-issue-132876.lyTQGZ.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2025-04-29-11-48-46.gh-issue-132876.lyTQGZ.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Misc/NEWS.d/next/Library/2025-04-29-11-48-46.gh-issue-132876.lyTQGZ.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do you want to add a Windows 10-only test maybe? I don't know how easy it would be to detect that we're on W10.
@picnixz, I just added test unconditionally (though, require IEEE 754). |
@skirpichev, do you need someone else to merge this? I believe all comments have been addressed. |
Yeah, someone with commit bit :-) |
Ah - I didn't realize you don't have that! I'll do it now 😄 , |
cf8941c
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@skirpichev for the PR, and@tim-one for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…3135)*pythongh-132876: workaround broken ldexp() on Windows 10ldexp() fails to round subnormal results before Windows 11,so hide their bug.(cherry picked from commitcf8941c)Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>Co-authored-by: Tim Peters <tim.peters@gmail.com>
Sorry,@skirpichev and@tim-one, I could not cleanly backport this to
|
GH-134684 is a backport of this pull request to the3.14 branch. |
FYI, I'm ignoring the auto-generated backport messages. Partly because I don't understand how that works 😦 . |
skirpichev commentedMay 26, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The witch failed to do her job. I'll prepare manual backport for 3.13. |
GH-134685 is a backport of this pull request to the3.13 branch. |
…#134684)gh-132876: workaround broken ldexp() on Windows 10 (GH-133135)*gh-132876: workaround broken ldexp() on Windows 10ldexp() fails to round subnormal results before Windows 11,so hide their bug.(cherry picked from commitcf8941c)Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>Co-authored-by: Tim Peters <tim.peters@gmail.com>
Thanks for merging this Tim! FYI, I never merge something after 8 PM or when I'm not on Linux, just to be sure I can quickly revert if I made a mistake. |
FYI, I'm retired and "8pm" doesn't mean much of anything to me 😉. If I had to stay awake for another 12 hours to repair problems, that would have been OK. This PR was ready to merge for weeks already, passed exhaustive reviews by multiple capable reviewers, and is a straightforward, localized change. While a chance of unforeseen disaster is never absent, it looked as safe as a PR gets 😄 |
Uh oh!
There was an error while loading.Please reload this page.
ldexp()
on Windows doesn't round subnormal results before Windows 11, but should. Python's :func:math.ldexp
wrapper now does round them.