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