Expand description
Functions related to Materialize’s numeric type, which is largely a wrapper
around rust-dec
.
Modules§
- Module to simplify serde’ing a
Numeric
through its string representation.
Structs§
- The error returned when constructing a
NumericMaxScale
from an invalid value. - The
max_scale
of aScalarType::Numeric
. - An encoded packed variant of
Numeric
. - Helper struct for representing
Option<NumericMaxScale>
.
Constants§
- The maximum number of digits expressable in a
NumericAgg
value. - The number of internal decimal units in a
NumericAgg
value. - The value of
NUMERIC_AGG_WIDTH
as au8
. - The maximum number of digits expressable in a
Numeric
value. - The number of internal decimal units in a
Numeric
value. - The value of
NUMERIC_DATUM_WIDTH
as au8
.
Statics§
Traits§
- Traits to generalize converting
Decimal
values to and from their coefficients’ two’s complements. - A type that can represent Real Numbers. Useful for interoperability between Numeric and floating point.
Functions§
- Returns a new context appropriate for operating on numeric aggregates.
- Returns a new context appropriate for operating on numeric datums.
- Returns
n
’s precision, i.e. the total number of digits represented byn
in standard notation not including a zero in the “one’s place” in (-1,1). - Returns
n
’s scale, i.e. the number of digits used after the decimal point. - Ensures
Numeric
values are: - Using negative binary numbers can require more digits of precision than
Numeric
offers, so we need to have the option to swap bytes’ signs at the byte- rather than the library-level. - Converts an
Numeric
into its big endian two’s complement representation. - Converts an
Numeric
into a big endian two’s complement representation where the encoded value hasNUMERIC_AGG_MAX_PRECISION
digits and a scale ofNUMERIC_DATUM_MAX_PRECISION
. - Rescale
n
as anOrderedDecimal
with the described scale, or error if: - Rescale’s
n
to fit withinNumeric
’s max precision or error if not possible. - Parses a buffer of two’s complement digits in big-endian order and converts them to
Decimal<N>
.
Type Aliases§
- A numeric value.
- A double-width version of
Numeric
for use in aggregations.