summaryrefslogtreecommitdiff
path: root/tests/float
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2023-02-16 10:26:33 +1100
committerDamien George <damien@micropython.org>2023-02-16 10:26:33 +1100
commit799d88818232a1c73095e848c116170d7db1852e (patch)
tree1a6853b24c053e167919dc622260320c11d72976 /tests/float
parentfe330c74f430a006cb54fff250ed22d7038fb6d0 (diff)
tests/float: Add domain checks for log and also -inf.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/float')
-rw-r--r--tests/float/math_domain.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/float/math_domain.py b/tests/float/math_domain.py
index 0c25dc08b..d4c45fa3b 100644
--- a/tests/float/math_domain.py
+++ b/tests/float/math_domain.py
@@ -17,6 +17,7 @@ for name, f, args in (
("trunc", math.trunc, ()),
("sqrt", math.sqrt, (-1, 0)),
("exp", math.exp, ()),
+ ("log", math.log, ()),
("sin", math.sin, ()),
("cos", math.cos, ()),
("tan", math.tan, ()),
@@ -27,7 +28,7 @@ for name, f, args in (
("radians", math.radians, ()),
("degrees", math.degrees, ()),
):
- for x in args + (inf, nan):
+ for x in args + (inf, -inf, nan):
try:
ans = f(x)
print("%.4f" % ans)
@@ -39,6 +40,7 @@ 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), (nan, 0), (1, nan))),
+ ("log", math.log, ()),
("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, ()),