Decimal.normalized

Normalize mantissa and exponent.

struct Decimal
@property const @nogc nothrow pure scope
normalized
()

Return Value

Type: Decimal

normalized value.

Examples

assert(Decimal.init.normalized.mantissa == 0);
assert(Decimal.init.normalized.exponent == 0);

assert(Decimal(100, 0).normalized.mantissa == 100);
assert(Decimal(100, 0).normalized.exponent == 0);

assert(Decimal(100, 2).normalized.mantissa == 1);
assert(Decimal(100, 2).normalized.exponent == 0);

assert(Decimal(120, 2).normalized.mantissa == 12);
assert(Decimal(120, 2).normalized.exponent == 1);

assert(Decimal(123, 2).normalized.mantissa == 123);
assert(Decimal(123, 2).normalized.exponent == 2);

assert(Decimal(12340000, 2).normalized.mantissa == 123400);
assert(Decimal(12340000, 2).normalized.exponent == 0);

Meta