Trait rug::ops::RemFrom
[−]
[src]
pub trait RemFrom<Lhs = Self> { fn rem_from(&mut self, lhs: Lhs); }
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);
Required Methods
fn rem_from(&mut self, lhs: Lhs)
Peforms the remainder operation.
Examples
use rug::Integer; use rug::ops::RemFrom; let mut rhs = Integer::from(2); rhs.rem_from(17); // rhs = 17 / 2 assert_eq!(rhs, 1);
Implementors
impl RemFrom for i8
impl RemFrom for i16
impl RemFrom for i32
impl RemFrom for i64
impl RemFrom for isize
impl RemFrom for u8
impl RemFrom for u16
impl RemFrom for u32
impl RemFrom for u64
impl RemFrom for usize
impl RemFrom<Integer> for Integer
impl<'a> RemFrom<&'a Integer> for Integer
impl RemFrom<i32> for Integer
impl RemFrom<u32> for Integer