Skip to main content

round_to_nearest

Function round_to_nearest 

Source
fn round_to_nearest(value: f64, nearest: f64) -> f64
Expand description

Rounds like Prometheus: ties round up (towards +Inf), and multiplying by the inverse of nearest follows its float behavior, including NaN for nearest == 0.