Math module

is_finite

procedure · 2 overloadsSource

True when x is neither NaN nor infinite.

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

Whether x is neither NaN nor infinite.

Parameters

x: float64
the value to test.

Returns

bool
is_finite :: (x: float) -> bool

Whether x is neither NaN nor infinite.

Parameters

x: float
the value to test.

Returns

bool

See also