signbit

Returns the sign bit of the specified value. This operation is silent, no error flags are set and no exceptions are thrown.

@IEEECompliant("isSignMinus", 25)
int
signbit
(
D : Decimal!bits
int bits
)
(
auto const ref D x
)

Parameters

x D

a _decimal value

Return Value

Type: int

1 if the sign bit is set, 0 otherwise

Examples

assert(signbit(-decimal32.infinity) == 1);
assert(signbit(decimal64.min_normal) == 0);
assert(signbit(-decimal128.max) == 1);

Meta