Files
pplus-library/mojo/probes/math-inf-nan.mojo
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

10 lines
408 B
Mojo

# probe: inf[DType.float64]() and nan[DType.float64]() from std.math (and their Float32 forms): how they print, compare and classify
from std.math import inf, nan, isnan, isinf
def main():
var i = inf[DType.float64]()
var n = nan[DType.float64]()
print(i, -i, n, -n, i > 1e308, n == n, n != n, isnan(n), isinf(i))
print(inf[DType.float32](), nan[DType.float32](), i - i, 0.0 * i, i * -1.0)