Function isSubnormal
Determines whether x is a denormilized number or not.
bool isSubnormal(F)
(
F x
)
if (isFloatingPoint!F);
Denormalized number is a number between 0
and 1
that cannot 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 denormilized number, false otherwise.
See Also
isNormal.
Example
assert(!isSubnormal(0.0f));
assert(!isSubnormal(float .nan));
assert(!isSubnormal(float .infinity));
assert(!isSubnormal(0.3f));
assert(isSubnormal(5.87747e-38f / 10));
assert(!isSubnormal(0.0));
assert(!isSubnormal(double .nan));
assert(!isSubnormal(double .infinity));
assert(!isSubnormal(1.4));
assert(isSubnormal(1.11254e-307 / 10));
assert(!isSubnormal(0.0L));
assert(!isSubnormal(real .nan));
assert(!isSubnormal(real .infinity));