isSubnormal

Determines whether x is a denormilized number or not.

Denormalized number is a number between 0 and 1 that cannot 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
isSubnormal
(
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 denormilized number, $(D_KEYWORD false) otherwise.

Examples

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));

See Also

$(D_PSYMBOL isNormal).

Meta