2014-03-22 10:39:33 -04:00
|
|
|
# Test the bool functions from math
|
|
|
|
|
2014-06-19 18:50:49 -04:00
|
|
|
try:
|
|
|
|
from math import isfinite, isnan, isinf
|
|
|
|
except ImportError:
|
|
|
|
print("SKIP")
|
2017-06-08 00:00:57 -04:00
|
|
|
raise SystemExit
|
2014-03-22 10:39:33 -04:00
|
|
|
|
2020-05-30 05:44:13 -04:00
|
|
|
test_values = [1, 0, -1, 1.0, 0.0, -1.0, float('NaN'), float('Inf'),
|
2014-03-22 10:39:33 -04:00
|
|
|
-float('NaN'), -float('Inf')]
|
|
|
|
|
|
|
|
functions = [isfinite, isnan, isinf]
|
|
|
|
|
|
|
|
for val in test_values:
|
|
|
|
for f in functions:
|
|
|
|
print(f(val))
|