Skip to main content

Crate feldera_fxp

Crate feldera_fxp 

Source
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 on rkyv): Implements rkyv traits for validation.

  • size_of: Implements size_of traits for measuring data sizes.

  • dbsp (depends on serde, rkyv, and size_of): Implements DBSP traits for Fixed and DynamicDecimal.

Structs§

DynamicDecimal
Decimal real number with 38 digits of precision and dynamic scale.
Fixed
Decimal real number with fixed precision and scale.
OutOfRange
Error returned for operations that would produce an out-of-range result.
UniformDecimal
Supports uniform sampling for DynamicDecimals with a specified scale.

Enums§

ParseDecimalError
Error that can be returned when parsing Fixed or DynamicDecimal.

Functions§

pow10
Returns 10**exponent.

Type Aliases§

FixedInteger
A maximum-precision Fixed with no decimal places.