summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/math_fun.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-04-04 22:05:30 +0100
committerDamien George <damien.p.george@gmail.com>2015-04-04 22:05:30 +0100
commit9dd36404646f857c4f250537bac0d9a8ad041d25 (patch)
treec6509bcd3c7d5c2e67332110c582df2b5a5c669f /tests/float/math_fun.py
parent7e758b1cf878312cab5d9d2825b36e7235ea10a3 (diff)
downloadmicropython-9dd36404646f857c4f250537bac0d9a8ad041d25.tar.gz
micropython-9dd36404646f857c4f250537bac0d9a8ad041d25.zip
tests: Add missing tests for builtins, and many other things.
Diffstat (limited to 'tests/float/math_fun.py')
-rw-r--r--tests/float/math_fun.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/float/math_fun.py b/tests/float/math_fun.py
index 03ee8e85d2..16aec76f92 100644
--- a/tests/float/math_fun.py
+++ b/tests/float/math_fun.py
@@ -33,7 +33,9 @@ functions = [('sqrt', sqrt, p_test_values),
('ceil', ceil, test_values),
('fabs', fabs, test_values),
('floor', floor, test_values),
- ('trunc', trunc, test_values)
+ ('trunc', trunc, test_values),
+ ('radians', radians, test_values),
+ ('degrees', degrees, test_values),
]
for function_name, function, test_vals in functions:
@@ -52,10 +54,14 @@ for function_name, function, test_vals in tuple_functions:
print("{:.5g} {:.5g}".format(x, y))
binary_functions = [('copysign', copysign, [(23., 42.), (-23., 42.), (23., -42.),
- (-23., -42.), (1., 0.0), (1., -0.0)])
+ (-23., -42.), (1., 0.0), (1., -0.0)]),
+ ('pow', pow, ((1., 0.), (0., 1.), (2., 0.5), (-3., 5.), (-3., -4.),)),
+ ('atan2', atan2, ((1., 0.), (0., 1.), (2., 0.5), (-3., 5.), (-3., -4.),)),
+ ('fmod', fmod, ((1., 1.), (0., 1.), (2., 0.5), (-3., 5.), (-3., -4.),)),
+ ('ldexp', ldexp, ((1., 0), (0., 1), (2., 2), (3., -2), (-3., -4),)),
]
for function_name, function, test_vals in binary_functions:
print(function_name)
for value1, value2 in test_vals:
- print("{:.7g}".format(function(value1, value2)))
+ print("{:.5g}".format(function(value1, value2)))