summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/math-fun-bool.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/float/math-fun-bool.py')
-rw-r--r--tests/float/math-fun-bool.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/float/math-fun-bool.py b/tests/float/math-fun-bool.py
new file mode 100644
index 0000000000..cf718d4b80
--- /dev/null
+++ b/tests/float/math-fun-bool.py
@@ -0,0 +1,12 @@
+# Test the bool functions from math
+
+from math import isfinite, isnan, isinf
+
+test_values = [1, 0, -1, 1.0, 0.0, -1.0, float('NaN'), float('Inf'),
+ -float('NaN'), -float('Inf')]
+
+functions = [isfinite, isnan, isinf]
+
+for val in test_values:
+ for f in functions:
+ print(f(val))