f64_to_fixed_i64

Function f64_to_fixed_i64 

Source
pub fn f64_to_fixed_i64(value: f64, precision: u8) -> i64
Expand description

Converts an f64 value to a raw fixed-point i64 representation with a specified precision.

§Precision and Rounding

This function performs IEEE 754 “round half to even” rounding at the specified precision before scaling to the fixed-point representation. The rounding is intentionally applied at the user-specified precision level to ensure values are correctly represented without accumulating floating-point errors during scaling.

§Panics

Panics if precision exceeds FIXED_PRECISION.