isNormal

Determines if x is normalized.

A normalized number must not be zero, subnormal, infinite nor NaN.

@trusted pure nothrow @nogc
bool
isNormal
(
X
)
(
X x
)

Parameters

x X

a floating point number.

Return Value

Type: bool

true if x is normalized.

Examples

float f = 3;
double d = 500;
real e = 10e+48;

assert(isNormal(f));
assert(isNormal(d));
assert(isNormal(e));
f = d = e = 0;
assert(!isNormal(f));
assert(!isNormal(d));
assert(!isNormal(e));
assert(!isNormal(real.infinity));
assert(isNormal(-real.max));
assert(!isNormal(real.min_normal/4));

Meta