Skip to main content

quantize

Function quantize 

Source
pub fn quantize(pts: f64, quantum_per_point: u32) -> Result<i64, QuantizeError>
Expand description

Quantize a point-space coordinate to integer quanta: round_half_away_from_zero(pts × quantum_per_point).

This is the only permitted float math on the canonical path; IEEE-754 double multiply + floor/ceil on identical inputs is identical across supported platforms.