-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
This file tested, using result_check() helper:
Line 175 in beee91c
def result_check(expected, got, ulp_tol=5, abs_tol=0.0): |
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
# if both a and b are zero, check whether they have the same sign | |
# (in theory there are examples where it would be legitimate for a | |
# and b to have opposite signs; in practice these hardly ever | |
# occur). | |
if not a and not b: | |
if math.copysign(1., a) != math.copysign(1., b): | |
self.fail(msg or 'zero has wrong sign: expected {!r}, ' | |
'got {!r}'.format(a, b)) |
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
- gh-123836: check zero signs in math_testcases.txt #123854
- [3.13] gh-123836: Check zero signs in math_testcases.txt (GH-123854) #124161
- [3.12] gh-123836: Check zero signs in math_testcases.txt (GH-123854) #124162
- gh-123836: workaround fmod(x, y) bug on Windows #124171
- [3.12] gh-123836: workaround fmod(x, y) bug on Windows (GH-124171) #124186
- [3.13] gh-123836: workaround fmod(x, y) bug on Windows (GH-124171) #124187
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement