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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

skirpichev
Copy link
Member

@skirpichev skirpichev commented Apr 29, 2025

ldexp() on Windows doesn't round subnormal results before Windows 11, but should. Python's :func:math.ldexp wrapper now does round them.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
@skirpichev
Copy link
Member Author

Some benchmarking in: #132876 (comment)

@skirpichev skirpichev requested a review from tim-one April 29, 2025 18:26
Copy link
Member

@tim-one tim-one left a 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?

@zooba
Copy link
Member

zooba commented Apr 29, 2025

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

@skirpichev skirpichev requested a review from zooba April 30, 2025 07:27
@skirpichev skirpichev requested a review from tim-one April 30, 2025 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants