summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/math-fun.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.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.py')
-rw-r--r--tests/basics/math-fun.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/basics/math-fun.py b/tests/basics/math-fun.py
index f5ffbf40d5..1301dc2a5b 100644
--- a/tests/basics/math-fun.py
+++ b/tests/basics/math-fun.py
@@ -5,8 +5,6 @@ from math import *
test_values = [-100., -1.23456, -1, -0.5, 0.0, 0.5, 1.23456, 100.]
p_test_values = [0.1, 0.5, 1.23456]
unit_range_test_values = [-1., -0.75, -0.5, -0.25, 0., 0.25, 0.5, 0.75, 1.]
-#IEEE_test_values = [1, 0, float('NaN'), float('Inf'), -float('NaN'), -float('Inf')]
-#TODO: float('NaN')
functions = [(sqrt, p_test_values),
(exp, test_values),
@@ -30,7 +28,6 @@ functions = [(sqrt, p_test_values),
(fabs, test_values),
(floor, test_values),
#(frexp, test_values),
- #(isfinite, [1, 0, float('NaN'), float('Inf')])
(trunc, test_values)
]
@@ -42,8 +39,8 @@ binary_functions = [(copysign, [(23., 42.), (-23., 42.), (23., -42.),
(-23., -42.), (1., 0.0), (1., -0.0)])
]
-#for function, test_vals in binary_functions:
-# for value1, value2 in test_vals:
-# print("{:8.7f}".format(function(value1, value2)))
+for function, test_vals in binary_functions:
+ for value1, value2 in test_vals:
+ print("{:8.7f}".format(function(value1, value2)))