Skip to main content

full_mul_div_operands

Function full_mul_div_operands 

Source
pub(super) fn full_mul_div_operands(
    expr: &SymExpr,
) -> Option<(&SymExpr, &SymExpr, &SymExpr)>
Expand description

Returns (a, b, d) when expr is the 512-by-256-bit mulDiv(a, b, d) quotient.

For any d != 0 the algorithm computes floor(a * b / d) modulo 2**256. The rewrite is still applied only under the library’s own mul_high(a, b) < d check, where the quotient fits a word and the truncation never matters.