Skip to main content

round_f64

Function round_f64 

Source
pub fn round_f64(v: f64, mode: Rounding) -> f64
Expand description

Round a float to an integer under an explicit Rounding mode.

Split out because CVT.W, ROUND.W, TRUNC.W, CEIL.W and FLOOR.W differ only in this: CVT uses FCSR.RM, and the other four hard-code one mode each. Sharing the body means a rounding bug cannot exist in one and not the others.