-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Testing math_testcases.txt lacks support for signed zeros #123836
Labels
Comments
skirpichev
added a commit
to skirpichev/cpython
that referenced
this issue
Sep 9, 2024
Just like cmath_testcases.txt. These tests require IEEE 754 anyway.
PR is ready for review: #123854 |
vstinner
pushed a commit
that referenced
this issue
Sep 17, 2024
Just like cmath_testcases.txt. These tests require IEEE 754 anyway. Correct zero sign for sqrt tests to match math.h convention.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 17, 2024
) Just like cmath_testcases.txt. These tests require IEEE 754 anyway. Correct zero sign for sqrt tests to match math.h convention. (cherry picked from commit 28aea5d) Co-authored-by: Sergey B Kirpichev <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 17, 2024
) Just like cmath_testcases.txt. These tests require IEEE 754 anyway. Correct zero sign for sqrt tests to match math.h convention. (cherry picked from commit 28aea5d) Co-authored-by: Sergey B Kirpichev <[email protected]>
This was referenced Sep 17, 2024
Implemented as 28aea5d. Backports will follow. |
vstinner
pushed a commit
that referenced
this issue
Sep 17, 2024
…124162) gh-123836: Check zero signs in math_testcases.txt (GH-123854) Just like cmath_testcases.txt. These tests require IEEE 754 anyway. Correct zero sign for sqrt tests to match math.h convention. (cherry picked from commit 28aea5d) Co-authored-by: Sergey B Kirpichev <[email protected]>
This broke the Windows 10 buildbot: #123854 (comment) |
skirpichev
added a commit
to skirpichev/cpython
that referenced
this issue
Sep 17, 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) This amends 28aea5d.
skirpichev
added a commit
to skirpichev/cpython
that referenced
this issue
Sep 17, 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 result should have the same sign as x. This amends 28aea5d.
Fix: #124171 |
vstinner
pushed a commit
that referenced
this issue
Sep 17, 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 result should have the same sign as x. This amends commit 28aea5d.
skirpichev
added a commit
to skirpichev/cpython
that referenced
this issue
Sep 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 result should have the same sign as x. This amends commit 28aea5d. (cherry picked from commit f4dd440) Co-authored-by: Sergey B Kirpichev <[email protected]>
vstinner
pushed a commit
that referenced
this issue
Sep 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 result should have the same sign as x. This amends commit 28aea5d. (cherry picked from commit f4dd440)
savannahostrowski
pushed a commit
to savannahostrowski/cpython
that referenced
this issue
Sep 22, 2024
Just like cmath_testcases.txt. These tests require IEEE 754 anyway. Correct zero sign for sqrt tests to match math.h convention.
savannahostrowski
pushed a commit
to savannahostrowski/cpython
that referenced
this issue
Sep 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 result should have the same sign as x. This amends commit 28aea5d.
Yhg1s
pushed a commit
that referenced
this issue
Sep 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 result should have the same sign as x. This amends commit 28aea5d. (cherry picked from commit f4dd440)
Yhg1s
pushed a commit
that referenced
this issue
Sep 30, 2024
…124161) gh-123836: Check zero signs in math_testcases.txt (GH-123854) Just like cmath_testcases.txt. These tests require IEEE 754 anyway. Correct zero sign for sqrt tests to match math.h convention. (cherry picked from commit 28aea5d) Co-authored-by: Sergey B Kirpichev <[email protected]>
Congrats @skirpichev for this nice enhancement. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature or enhancement
Proposal:
This file tested, using result_check() helper:
cpython/Lib/test/test_math.py
Line 175 in beee91c
which lacks checking of zero sign (while some entries in the data file - have signed zeros). C.f. cmath_testcases.txt, which tested with rAssertAlmostEqual(), that has such special case:
cpython/Lib/test/test_cmath.py
Lines 124 to 131 in beee91c
I think that first helper should be adjusted to do same. I'll work on a patch.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: