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")
|
|
|
|
import sys
|
|
|
|
sys.exit()
|
2014-03-22 14:39:33 +00:00
|
|
|
|
|
|
|
test_values = [1, 0, -1, 1.0, 0.0, -1.0, float('NaN'), float('Inf'),
|
|
|
|
-float('NaN'), -float('Inf')]
|
|
|
|
|
|
|
|
functions = [isfinite, isnan, isinf]
|
|
|
|
|
|
|
|
for val in test_values:
|
|
|
|
for f in functions:
|
|
|
|
print(f(val))
|