Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
tim-one merged 10 commits intopython:mainfromskirpichev:fix-ldexp-MS/132876
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Apply suggestions from code review
  • Loading branch information
@skirpichev
skirpichev authoredApr 30, 2025
commite105d7646076ddd593e3f06b0b37ee43e525b768
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
Workaround broken ``ldexp()`` implementation on Windows 10.
`ldexp()` on Windows doesn't round subnormal results before Windows 11, but should. Python's :func:`math.ldexp` wrapper now does round them, so results may change
slightly, in rare cases of very small results, on Windows versions before 11.
2 changes: 1 addition & 1 deletionModules/mathmodule.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2164,7 +2164,7 @@ math_ldexp_impl(PyObject *module, double x, PyObject *i)
errno = 0;
r = ldexp(x, (int)exp);
#ifdef _MSC_VER
if (-DBL_MIN< r && r<DBL_MIN) {
if (DBL_MIN> r && r> -DBL_MIN) {
/* Denormal (or zero) results can be incorrectly rounded here (rather,
truncated). Fixed in newer versions of the C runtime, included
with Windows 11. */
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp