summaryrefslogtreecommitdiff
path: root/tests/float/math_domain_special.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/float/math_domain_special.py')
-rw-r--r--tests/float/math_domain_special.py39
1 files changed, 20 insertions, 19 deletions
diff --git a/tests/float/math_domain_special.py b/tests/float/math_domain_special.py
index 5650c35fe..880594dce 100644
--- a/tests/float/math_domain_special.py
+++ b/tests/float/math_domain_special.py
@@ -2,35 +2,36 @@
try:
import math
+
math.erf
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
-inf = float('inf')
-nan = float('nan')
+inf = float("inf")
+nan = float("nan")
# single argument functions
for name, f, args in (
- ('expm1', math.exp, ()),
- ('log2', math.log2, (-1, 0)),
- ('log10', math.log10, (-1, 0)),
- ('sinh', math.sinh, ()),
- ('cosh', math.cosh, ()),
- ('tanh', math.tanh, ()),
- ('asinh', math.asinh, ()),
- ('acosh', math.acosh, (-1, 0.9, 1)),
- ('atanh', math.atanh, (-1, 1)),
- ('erf', math.erf, ()),
- ('erfc', math.erfc, ()),
- ('gamma', math.gamma, (-2, -1, 0, 1)),
- ('lgamma', math.lgamma, (-2, -1, 0, 1)),
- ):
+ ("expm1", math.exp, ()),
+ ("log2", math.log2, (-1, 0)),
+ ("log10", math.log10, (-1, 0)),
+ ("sinh", math.sinh, ()),
+ ("cosh", math.cosh, ()),
+ ("tanh", math.tanh, ()),
+ ("asinh", math.asinh, ()),
+ ("acosh", math.acosh, (-1, 0.9, 1)),
+ ("atanh", math.atanh, (-1, 1)),
+ ("erf", math.erf, ()),
+ ("erfc", math.erfc, ()),
+ ("gamma", math.gamma, (-2, -1, 0, 1)),
+ ("lgamma", math.lgamma, (-2, -1, 0, 1)),
+):
for x in args + (inf, -inf, nan):
try:
ans = f(x)
- print('%.4f' % ans)
+ print("%.4f" % ans)
except ValueError:
- print(name, 'ValueError')
+ print(name, "ValueError")
except OverflowError:
- print(name, 'OverflowError')
+ print(name, "OverflowError")