Trait rug::ops::RemFrom [−][src]
pub trait RemFrom<Lhs = Self> { fn rem_from(&mut self, lhs: Lhs); }
Expand description
Compound remainder operation and assignment to the rhs operand.
rhs.rem_from(lhs)
has the same effect as rhs = lhs % rhs
.
Examples
use rug::ops::RemFrom; struct I(i32); impl RemFrom<i32> for I { fn rem_from(&mut self, lhs: i32) { self.0 = lhs % self.0; } } let mut i = I(10); i.rem_from(42); assert_eq!(i.0, 2);