sp_runtime::helpers_128bit

Function multiply_by_rational_with_rounding

source
pub const fn multiply_by_rational_with_rounding(
    a: u128,
    b: u128,
    c: u128,
    r: Rounding,
) -> Option<u128>
Expand description

Returns a * b / c (wrapping to 128 bits) or None in the case of overflow.