summaryrefslogtreecommitdiffstatshomepage
path: root/tests/float/math_constants_extra.py
blob: 756cb458036964e6b58600ec944d66d64b5089a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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.copysign(1.0, math.tau))

print(math.inf == float("inf"))
print(-math.inf == -float("inf"))
print(math.copysign(1.0, math.inf))

print(isnan(math.nan))
print(isnan(-math.nan))
print(math.copysign(1.0, math.nan))