Expand description
Decimal arithmetic.
This crate primarily provides the Fixed type for decimal arithmetic with precision and scale supplied as type parameters. It also provides DynamicDecimal, which has 38 digits of precision and a dynamic scale. The latter is mainly provided for serialization and does not include much in the way of arithmetic.
§Features
The following cargo features are provided:
-
serde: Implements serde traits for serializing and deserializing Fixed and DynamicDecimal. -
rkyv: Implements rkyv traits for serializing and deserializing Fixed and DynamicDecimal. -
validation(depends onrkyv): Implements rkyv traits for validation. -
size_of: Implements size_of traits for measuring data sizes. -
dbsp(depends onserde,rkyv, andsize_of): Implements DBSP traits for Fixed and DynamicDecimal.
Structs§
- Dynamic
Decimal - Decimal real number with 38 digits of precision and dynamic scale.
- Fixed
- Decimal real number with fixed precision and scale.
- OutOf
Range - Error returned for operations that would produce an out-of-range result.
- Uniform
Decimal - Supports uniform sampling for DynamicDecimals with a specified scale.
Enums§
- Parse
Decimal Error - Error that can be returned when parsing Fixed or DynamicDecimal.
Functions§
- pow10
- Returns
10**exponent.
Type Aliases§
- Fixed
Integer - A maximum-precision
Fixedwith no decimal places.