Skip to main content

exact_divide

Function exact_divide 

Source
pub fn exact_divide(
    left: RuntimeValue,
    right: RuntimeValue,
) -> Result<RuntimeValue, String>
Expand description

EXACT division — the runtime of BinaryOpKind::ExactDivide, the type-directed sibling of divide. An evenly-dividing integer pair stays an Int/BigInt; otherwise the quotient is an exact Rational (7 / 2 → 7/2) — it NEVER truncates. A Float operand divides as Float (floats are inexact by choice). This only ever runs where the type says the result is a Rational, so floor code is untouched.