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

mul_div_u32

Function mul_div_u32 

Source
pub fn mul_div_u32(a: u32, b: u32, divisor: u32) -> u32
Expand description

Exact floor(a * b / divisor) when the quotient fits u32.

Requires a nonzero divisor. R3000 MULTU supplies both product words; ordinary products use native 32-bit DIVU, and only overflowing products need the two-word restoring division. No compiler wide-division helper.