Skip to main content

Module decimal

Module decimal 

Source
Expand description

Fixed-point decimal with nine fractional digits.

A Decimal is an i128 count of units of 10^-9. It is exact: parsing never rounds, and every arithmetic operation either returns an exact or explicitly rounded result or a typed ArithError. Nothing saturates, wraps or clamps.

Structs§

Decimal
An exact decimal value units / 10^9.

Enums§

ArithError
Why an arithmetic operation produced no value.
DecimalError
Why a decimal string was refused.
Rounding
Rounding applied when a result has more than SCALE fractional digits, or when Decimal::round_to_scale drops digits.

Constants§

SCALE
Number of fractional digits a Decimal carries.