isZero

Determines if x represents the value zero. This operation is silent, no error flags are set and no exceptions are thrown.

@"this must be fast"
@IEEECompliant("isZero", 25)
bool
isZero
(
D
)
(
auto const ref D x
)

Parameters

x D

a _decimal value

Return Value

Type: bool

true if x is zero, false otherwise (any other value than zero)

Examples

assert(isZero(decimal32(0)));
assert(!isZero(decimal64.nan));
assert(isZero(decimal32("0x9FFFFFp+10")));

Meta

Standards

If the internal representation of the _decimal data type has a coefficient greater that 10precision - 1, is considered 0 according to IEEE standard.