circuitpython/tests/float/math_constants_extra.py
stijn dd6967202a py/modmath: Add math.tau, math.nan and math.inf constants.
Configurable by the new MICROPY_PY_MATH_CONSTANTS option.
2022-01-23 09:28:33 +11:00

18 lines
372 B
Python

# Tests constants of the math module available only with MICROPY_PY_MATH_CONSTANTS.
try:
import math
from math import isnan
math.tau
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
print(math.tau == 2.0 * math.pi)
print(math.inf == float("inf"))
print(-math.inf == -float("inf"))
print(isnan(math.nan))
print(isnan(-math.nan))