Module fixed

Module fixed 

Source
Expand description

Functions for handling fixed-point arithmetic.

This module provides constants and functions that enforce a fixed-point precision strategy, ensuring consistent precision and scaling across various types and calculations.

Constants§

FIXED_PRECISION
The maximum fixed-point precision.
FIXED_SCALAR
The scalar value corresponding to the maximum precision (10^16).
FIXED_SIZE_BINARY
The data type name for the Arrow fixed-size binary representation.
MAX_FLOAT_PRECISION
The maximum precision that can be safely used with f64-based constructors.
PRECISION_BYTES
The width in bytes for fixed-point value types in high-precision mode (128-bit).
PRECISION_DIFF_SCALAR
The scalar representing the difference between high-precision and standard-precision modes.

Statics§

HIGH_PRECISION_MODE
Indicates if high-precision mode is enabled.

Functions§

check_fixed_precision
Checks if a given precision value is within the allowed fixed-point precision range.
f64_to_fixed_i64
Converts an f64 value to a raw fixed-point i64 representation with a specified precision.
f64_to_fixed_i128
Converts an f64 value to a raw fixed-point i128 representation with a specified precision.
f64_to_fixed_u64
Converts an f64 value to a raw fixed-point u64 representation with a specified precision.
f64_to_fixed_u128
Converts an f64 value to a raw fixed-point u128 representation with a specified precision.
fixed_i64_to_f64
Converts a raw fixed-point i64 value back to an f64 value.
fixed_i128_to_f64
Converts a raw fixed-point i128 value back to an f64 value.
fixed_u64_to_f64
Converts a raw fixed-point u64 value back to an f64 value.
fixed_u128_to_f64
Converts a raw fixed-point u128 value back to an f64 value.