T
– dividend type (left-hand operand)
U
– divisor type (right-hand operand, must be wrapped in
NonZero
at call-site)
The division truncates toward zero, like Cairo’s /
and %
.
Signature
Associated types
Quotient
– the type produced by the divisionRemainder
– the type produced by the modulo
Examples
Identical operand types:u256
by u128
):
Trait functions
div_rem
Computes both/
and %
in a single pass.