Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

mul_q12_i32_wide

Function mul_q12_i32_wide 

Source
pub fn mul_q12_i32_wide(value: i32, q12: i32) -> i32
Expand description

floor(value * q12 / 4096) through the full 64-bit product.

Identical to mul_q12_i32 wherever that function does not saturate, which is every product that fits in i32 (both are exactly the floored true product there; mul_q12_i32_matches_wide_where_exact pins it). It wraps instead of saturating beyond that range, so it is for hot paths whose inputs are bounded by construction: BSP plane distances (Q20.12 world points against Q3.12 unit normals) and segment interpolation. On MIPS this is one mult and a two-word shift instead of two saturating multiplies.