Module decimal

Source
Expand description

Maximum and minimum values for Decimal256 and Decimal128.

Also provides functions to validate if a given decimal value is within the valid range of the decimal type.

Constants§

DECIMAL128_MAX_PRECISION
The maximum precision for DataType::Decimal128 values
DECIMAL128_MAX_SCALE
The maximum scale for DataType::Decimal128 values
DECIMAL256_MAX_PRECISION
The maximum precision for DataType::Decimal256 values
DECIMAL256_MAX_SCALE
The maximum scale for DataType::Decimal256 values
DECIMAL_DEFAULT_SCALE
The default scale for DataType::Decimal128 and DataType::Decimal256 values
MAX_DECIMAL128_FOR_EACH_PRECISION
MAX_DECIMAL128_FOR_EACH_PRECISION[p] holds the maximum i128 value that can be stored in Decimal128 value of precision p.
MAX_DECIMAL256_FOR_EACH_PRECISION
MAX_DECIMAL256_FOR_EACH_PRECISION[p] holds the maximum i256 value that can be stored in a Decimal256 value of precision p.
MAX_DECIMAL_FOR_EACH_PRECISIONDeprecated
MAX_DECIMAL_FOR_EACH_PRECISION[p-1] holds the maximum i128 value that can be stored in a Decimal128 value of precision p
MIN_DECIMAL128_FOR_EACH_PRECISION
MIN_DECIMAL_FOR_EACH_PRECISION[p] holds the minimum i128 value that can be stored in a Decimal128 value of precision p.
MIN_DECIMAL256_FOR_EACH_PRECISION
MIN_DECIMAL256_FOR_EACH_PRECISION[p] holds the minimum i256 value that can be stored in a Decimal256 value of precision p.
MIN_DECIMAL_FOR_EACH_PRECISIONDeprecated
MIN_DECIMAL_FOR_EACH_PRECISION[p-1] holds the minimum i128 value that can be stored in a Decimal128 value of precision p

Functions§

is_validate_decimal256_precision
Return true if the specified i256 value can be properly interpreted as a Decimal256 number with precision precision
is_validate_decimal_precision
Returns true if the specified i128 value can be properly interpreted as a Decimal128 number with precision precision
validate_decimal256_precision
Validates that the specified i256 of value can be properly interpreted as a Decimal256 number with precision precision
validate_decimal_precision
Validates that the specified i128 value can be properly interpreted as a Decimal128 number with precision precision