Module malachite_nz::natural::arithmetic::mod_op
source · [−]Expand description
Implementations of traits for finding the remainder of two numbers, subject to various rounding rules.
These are the traits:
rounding | by value or reference | by mutable reference (assignment) |
---|---|---|
towards $-\infty$ | Mod | ModAssign |
towards $\infty$ | NegMod | NegModAssign |
NegMod
returns a remainder greater than or
equal to zero. This allows the remainder to have an unsigned type, but modifies the usual
relation $x = qy + r$ to $x = qy - r$.
The Rem
trait in the standard library rounds towards 0.