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.
This commit is contained in:
@@ -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)):
|
||||
|
||||
Reference in New Issue
Block a user