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")
|
|
|
|
import sys
|
|
|
|
sys.exit()
|
2014-03-22 10:39:33 -04: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))
|