tests/float: Test -inf and some larger values for special math funcs.

This commit is contained in:
Damien George 2018-09-04 17:03:37 +10:00
parent a111ca25ea
commit 5630f277bd
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ for name, f, args in (
('gamma', math.gamma, (-2, -1, 0, 1)), ('gamma', math.gamma, (-2, -1, 0, 1)),
('lgamma', math.lgamma, (-2, -1, 0, 1)), ('lgamma', math.lgamma, (-2, -1, 0, 1)),
): ):
for x in args + (inf, nan): for x in args + (inf, -inf, nan):
try: try:
ans = f(x) ans = f(x)
print('%.4f' % ans) print('%.4f' % ans)

View File

@ -16,7 +16,7 @@ functions = [
('log10', log10, test_values), ('log10', log10, test_values),
('cosh', cosh, test_values), ('cosh', cosh, test_values),
('sinh', sinh, test_values), ('sinh', sinh, test_values),
('tanh', tanh, test_values), ('tanh', tanh, [-1e6, -100] + test_values + [100, 1e6]),
('acosh', acosh, [1.0, 5.0, 1.0]), ('acosh', acosh, [1.0, 5.0, 1.0]),
('asinh', asinh, test_values), ('asinh', asinh, test_values),
('atanh', atanh, [-0.99, -0.5, 0.0, 0.5, 0.99]), ('atanh', atanh, [-0.99, -0.5, 0.0, 0.5, 0.99]),