Skip to main content

fp_mul_i_round_dw

Function fp_mul_i_round_dw 

Source
pub fn fp_mul_i_round_dw(a: i128, b: i128) -> Result<DoubleWord, SolMathError>
Expand description

Signed fixed-point multiply returning a DoubleWord: exact result split into standard-precision quotient and sub-ULP remainder.

dw.hi == fp_mul_i_round(a, b) for all inputs where a*b fits in i128. dw.lo is the exact remainder: |dw.lo| < SCALE_I. true_product(a, b) / SCALE = dw.hi + dw.lo / SCALE.

For inputs where a*b overflows i128, this function still rounds correctly (unlike fp_mul_i_round which truncates on its overflow path).