MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / round_f64

Function round_f64

crates/virtual-machine/src/cpu/alu.rs:249–258  ·  view source on GitHub ↗
(val: f64, rm: u8)

Source from the content-addressed store, hash-verified

247}
248
249pub fn round_f64(val: f64, rm: u8) -> f64 {
250 match rm {
251 RM_RNE => val.round_ties_even(),
252 RM_RTZ => val.trunc(),
253 RM_RDN => val.floor(),
254 RM_RUP => val.ceil(),
255 RM_RMM => val.round(),
256 _ => val,
257 }
258}
259
260// --- f32 rounding helpers: next representable value up/down ---
261

Callers 4

sat_f64_to_i32Function · 0.85
sat_f64_to_u32Function · 0.85
sat_f64_to_i64Function · 0.85
sat_f64_to_u64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected