summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/math-fun-bool.py
diff options
context:
space:
mode:
authorRachel Dowdall <rjdowdall@gmail.com>2014-03-22 14:39:33 +0000
committerRachel Dowdall <rjdowdall@gmail.com>2014-03-22 14:39:33 +0000
commit249b9c761d1fa0893740092df1d713ce0d91e856 (patch)
treef6638e1ac3349c50ade00fda4ac093c90c2d105e /tests/basics/math-fun-bool.py
parent17f45d41fefdb75fb76fca00ce4d7d5e158b6ea5 (diff)
downloadmicropython-249b9c761d1fa0893740092df1d713ce0d91e856.tar.gz
micropython-249b9c761d1fa0893740092df1d713ce0d91e856.zip
Fixed broken math functions that return bool and added some more.
Diffstat (limited to 'tests/basics/math-fun-bool.py')
-rw-r--r--tests/basics/math-fun-bool.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basics/math-fun-bool.py b/tests/basics/math-fun-bool.py
new file mode 100644
index 0000000000..cf718d4b80
--- /dev/null
+++ b/tests/basics/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))