isNormal

Determines whether x is a normilized number or not.

Normalized number is a number that can be represented as

<pre> m*2<sup>e</sup> </pre>

where m is the mantissa and e is an exponent that fits into the exponent field of the type F.

0 is neither normalized nor denormalized.

bool
isNormal
(
F
)
(
F x
)

Parameters

F

Type of the floating point number.

x F

Floating point number.

Return Value

Type: bool

$(D_KEYWORD true) if x is a normilized number, $(D_KEYWORD false) otherwise.

Examples

assert(!isNormal(0.0f));
assert(!isNormal(float.nan));
assert(!isNormal(float.infinity));
assert(isNormal(0.3f));
assert(!isNormal(5.87747e-38f / 10));

assert(!isNormal(0.0));
assert(!isNormal(double.nan));
assert(!isNormal(double.infinity));
assert(isNormal(1.4));
assert(!isNormal(1.11254e-307 / 10));

assert(!isNormal(0.0L));
assert(!isNormal(real.nan));
assert(!isNormal(real.infinity));

See Also

$(D_PSYMBOL isSubnormal).

Meta