Math module

isnan

procedure · 2 overloadsSource

True when x is NaN. This is the only reliable test, because NaN compares unequal to itself.

ExampleOpen in playground ↗
assert(isnan(FLOAT32_NAN) && !isnan(1.0) && !isnan(FLOAT32_INFINITY));
isnan :: (x: float64) -> bool

Whether x is NaN.

Parameters

x: float64
the value to test.

Returns

bool
isnan :: (x: float32) -> bool

Whether x is NaN.

Parameters

x: float32
the value to test.

Returns

bool

See also