Function isNormal
Determines whether x is a normilized number or not.
bool isNormal(F)
(
F x
)
if (isFloatingPoint!F);
Normalized number is a number that can be represented as
m*2e
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.
Parameters
Name | Description |
---|---|
F | Type of the floating point number. |
x | Floating point number. |
Returns
true if x is a normilized number, false otherwise.
See Also
isSubnormal.
Example
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));