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-123836: workaround fmod(x, y) bug on Windows#124171

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
vstinner merged 7 commits intopython:mainfromskirpichev:fix-fmod-win-123854
Sep 17, 2024

Conversation

@skirpichev
Copy link
Contributor

@skirpichevskirpichev commentedSep 17, 2024
edited
Loading

Buildbot failure on Windows 10 with MSC v.1916 64 bit (AMD64):

FAIL: testFmod (test.test_math.MathTests.testFmod) ---------------------------------------------------------------------- Traceback (most recent call last):  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 605, in testFmod    self.ftest('fmod(-10, 1)', math.fmod(-10, 1), -0.0)    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 258, in ftest    self.fail("{}: {}".format(name, failure))    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: fmod(-10, 1): expected -0.0, got 0.0 (zero has wrong sign)

Here Windows loose sign of the result; if y is nonzero, the result should have the same sign as x.

This amends28aea5d.

Buildbot failure on Windows 10 with MSC v.1916 64 bit (AMD64):FAIL: testFmod (test.test_math.MathTests.testFmod)----------------------------------------------------------------------Traceback (most recent call last):  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 605, in testFmod    self.ftest('fmod(-10, 1)', math.fmod(-10, 1), -0.0)    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 258, in ftest    self.fail("{}: {}".format(name, failure))    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: fmod(-10, 1): expected -0.0, got 0.0 (zero has wrong sign)Here Windows loose sign of the result; if y is nonzero, the resultshould have the same sign as x.This amends28aea5d.
@skirpichev
Copy link
ContributorAuthor

There are few other places in the math module, where fmod() is used. I kept library function: this bug shouldn't affect mentioned cases.

*/
doubler=fmod(x,y);

if (r==0.0&&y!=0.0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you make this code specific to Windows? For example, use#ifdef _MSC_VER. Move the comment on this part of the code in this case.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we sure that this issue specific only for Windows?

@skirpichevskirpichev marked this pull request as draftSeptember 17, 2024 14:24
@skirpichevskirpichev marked this pull request as ready for reviewSeptember 17, 2024 14:59
@skirpichevskirpichev added needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes labelsSep 17, 2024
Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@vstinnervstinnerenabled auto-merge (squash)September 17, 2024 17:14
@vstinnervstinner merged commitf4dd440 intopython:mainSep 17, 2024
@miss-islington-app
Copy link

Thanks@skirpichev for the PR, and@vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@skirpichev and@vstinner, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker f4dd4402108cc005d45acd4ca83c8530c36a93ca 3.13

@miss-islington-app
Copy link

Sorry,@skirpichev and@vstinner, I could not cleanly backport this to3.12 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker f4dd4402108cc005d45acd4ca83c8530c36a93ca 3.12

@skirpichevskirpichev deleted the fix-fmod-win-123854 branchSeptember 17, 2024 17:22
@vstinner
Copy link
Member

@skirpichev: You closed the PR, but automated backport failed. Would you mind to try to backport manually the fix to the 3.13 branch? Maybe from there, we can automate the backport to 3.12.

@bedevere-app
Copy link

GH-124186 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelSep 17, 2024
skirpichev added a commit to skirpichev/cpython that referenced this pull requestSep 17, 2024
…H-124171)Buildbot failure on Windows 10 with MSC v.1916 64 bit (AMD64):FAIL: testFmod (test.test_math.MathTests.testFmod)----------------------------------------------------------------------Traceback (most recent call last):  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 605, in testFmod    self.ftest('fmod(-10, 1)', math.fmod(-10, 1), -0.0)    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 258, in ftest    self.fail("{}: {}".format(name, failure))    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: fmod(-10, 1): expected -0.0, got 0.0 (zero has wrong sign)Here Windows loose sign of the result; if y is nonzero, the resultshould have the same sign as x.This amends commit28aea5d.(cherry picked from commitf4dd440)Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@bedevere-app
Copy link

GH-124187 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelSep 17, 2024
vstinner pushed a commit that referenced this pull requestSep 17, 2024
…124186)Buildbot failure on Windows 10 with MSC v.1916 64 bit (AMD64):FAIL: testFmod (test.test_math.MathTests.testFmod)----------------------------------------------------------------------Traceback (most recent call last):  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 605, in testFmod    self.ftest('fmod(-10, 1)', math.fmod(-10, 1), -0.0)    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 258, in ftest    self.fail("{}: {}".format(name, failure))    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: fmod(-10, 1): expected -0.0, got 0.0 (zero has wrong sign)Here Windows loose sign of the result; if y is nonzero, the resultshould have the same sign as x.This amends commit28aea5d.(cherry picked from commitf4dd440)
@vstinner
Copy link
Member

Thanks for the backports.

skirpichev reacted with thumbs up emoji

@zwarezware mentioned this pull requestSep 18, 2024
savannahostrowski pushed a commit to savannahostrowski/cpython that referenced this pull requestSep 22, 2024
Buildbot failure on Windows 10 with MSC v.1916 64 bit (AMD64):FAIL: testFmod (test.test_math.MathTests.testFmod)----------------------------------------------------------------------Traceback (most recent call last):  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 605, in testFmod    self.ftest('fmod(-10, 1)', math.fmod(-10, 1), -0.0)    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 258, in ftest    self.fail("{}: {}".format(name, failure))    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: fmod(-10, 1): expected -0.0, got 0.0 (zero has wrong sign)Here Windows loose sign of the result; if y is nonzero, the resultshould have the same sign as x.This amends commit28aea5d.
Yhg1s pushed a commit that referenced this pull requestSep 30, 2024
…124187)Buildbot failure on Windows 10 with MSC v.1916 64 bit (AMD64):FAIL: testFmod (test.test_math.MathTests.testFmod)----------------------------------------------------------------------Traceback (most recent call last):  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 605, in testFmod    self.ftest('fmod(-10, 1)', math.fmod(-10, 1), -0.0)    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 258, in ftest    self.fail("{}: {}".format(name, failure))    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: fmod(-10, 1): expected -0.0, got 0.0 (zero has wrong sign)Here Windows loose sign of the result; if y is nonzero, the resultshould have the same sign as x.This amends commit28aea5d.(cherry picked from commitf4dd440)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@vstinnervstinnervstinner approved these changes

Assignees

@vstinnervstinner

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@skirpichev@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp