Functions related to Materialize’s numeric type, which is largely a wrapper
The error returned when constructing a
NumericMaxScalefrom an invalid value.
Helper struct for representing
Traits to generalize converting
Decimalvalues to and from their coefficients’ two’s complements.
A type that can represent Real Numbers. Useful for interoperability between Numeric and floating point.
Returns a new context appropriate for operating on numeric aggregates.
Returns a new context appropriate for operating on numeric datums.
n’s precision, i.e. the total number of digits represented by
nin standard notation not including a zero in the “one’s place” in (-1,1).
n’s scale, i.e. the number of digits used after the decimal point.
Using negative binary numbers can require more digits of precision than
Numericoffers, so we need to have the option to swap bytes’ signs at the byte- rather than the library-level.
Numericinto its big endian two’s complement representation.
OrderedDecimalwith the described scale, or error if:
nto fit within
Numeric’s max precision or error if not possible.
Parses a buffer of two’s complement digits in big-endian order and converts them to