From 81db22f693d06468d45571a29fc0648a8f5664ce Mon Sep 17 00:00:00 2001 From: stijn Date: Sun, 17 May 2020 12:29:25 +0200 Subject: py/modmath: Work around msvc float bugs in atan2, fmod and modf. Older implementations deal with infinity/negative zero incorrectly. This commit adds generic fixes that can be enabled by any port that needs them, along with new tests cases. --- tests/float/math_domain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/float') diff --git a/tests/float/math_domain.py b/tests/float/math_domain.py index 2d4670f75..e63628cf5 100644 --- a/tests/float/math_domain.py +++ b/tests/float/math_domain.py @@ -39,8 +39,8 @@ for name, f, args in ( # double argument functions for name, f, args in ( ("pow", math.pow, ((0, 2), (-1, 2), (0, -1), (-1, 2.3))), - ("fmod", math.fmod, ((1.2, inf), (1.2, 0), (inf, 1.2))), - ("atan2", math.atan2, ((0, 0),)), + ("fmod", math.fmod, ((1.2, inf), (1.2, -inf), (1.2, 0), (inf, 1.2))), + ("atan2", math.atan2, ((0, 0), (-inf, inf), (-inf, -inf), (inf, -inf))), ("copysign", math.copysign, ()), ): for x in args + ((0, inf), (inf, 0), (inf, inf), (inf, nan), (nan, inf), (nan, nan)): -- cgit v1.2.3