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

Function round_f32

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

Source from the content-addressed store, hash-verified

236// --- FP rounding helpers ---
237
238pub fn round_f32(val: f32, rm: u8) -> f32 {
239 match rm {
240 RM_RNE => val.round_ties_even(),
241 RM_RTZ => val.trunc(),
242 RM_RDN => val.floor(),
243 RM_RUP => val.ceil(),
244 RM_RMM => val.round(),
245 _ => val,
246 }
247}
248
249pub fn round_f64(val: f64, rm: u8) -> f64 {
250 match rm {

Callers 4

sat_f32_to_i32Function · 0.85
sat_f32_to_u32Function · 0.85
sat_f32_to_i64Function · 0.85
sat_f32_to_u64Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected