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

mul_q16

Function mul_q16 

Source
pub const fn mul_q16(a: u32, b: u32) -> u32
Expand description

a * b for two Q16 numbers, without a 64-bit intermediate. The result must fit in u32.

use psx_seq::tables::mul_q16;
assert_eq!(mul_q16(1 << 16, 3 << 15), 3 << 15);
assert_eq!(mul_q16(2 << 16, 2 << 16), 4 << 16);