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)[src]

Peforms the remainder operation.

Examples

use rug::{ops::RemFrom, Integer};
let mut rhs = Integer::from(2);
rhs.rem_from(17);
// rhs = 17 / 2
assert_eq!(rhs, 1);
Loading content...

Implementations on Foreign Types

impl RemFrom<i8> for i8[src]

impl RemFrom<&'_ i8> for i8[src]

impl RemFrom<i16> for i16[src]

impl RemFrom<&'_ i16> for i16[src]

impl RemFrom<i32> for i32[src]

impl RemFrom<&'_ i32> for i32[src]

impl RemFrom<i64> for i64[src]

impl RemFrom<&'_ i64> for i64[src]

impl RemFrom<i128> for i128[src]

impl RemFrom<&'_ i128> for i128[src]

impl RemFrom<isize> for isize[src]

impl RemFrom<&'_ isize> for isize[src]

impl RemFrom<u8> for u8[src]

impl RemFrom<&'_ u8> for u8[src]

impl RemFrom<u16> for u16[src]

impl RemFrom<&'_ u16> for u16[src]

impl RemFrom<u32> for u32[src]

impl RemFrom<&'_ u32> for u32[src]

impl RemFrom<u64> for u64[src]

impl RemFrom<&'_ u64> for u64[src]

impl RemFrom<u128> for u128[src]

impl RemFrom<&'_ u128> for u128[src]

impl RemFrom<usize> for usize[src]

impl RemFrom<&'_ usize> for usize[src]

impl RemFrom<f32> for f32[src]

impl RemFrom<&'_ f32> for f32[src]

impl RemFrom<f64> for f64[src]

impl RemFrom<&'_ f64> for f64[src]

Loading content...

Implementors

impl RemFrom<&'_ f32> for Float[src]

impl RemFrom<&'_ f64> for Float[src]

impl RemFrom<&'_ i8> for Float[src]

impl RemFrom<&'_ i8> for Integer[src]

impl RemFrom<&'_ i16> for Float[src]

impl RemFrom<&'_ i16> for Integer[src]

impl RemFrom<&'_ i32> for Float[src]

impl RemFrom<&'_ i32> for Integer[src]

impl RemFrom<&'_ i64> for Float[src]

impl RemFrom<&'_ i64> for Integer[src]

impl RemFrom<&'_ i128> for Float[src]

impl RemFrom<&'_ i128> for Integer[src]

impl RemFrom<&'_ u8> for Float[src]

impl RemFrom<&'_ u8> for Integer[src]

impl RemFrom<&'_ u16> for Float[src]

impl RemFrom<&'_ u16> for Integer[src]

impl RemFrom<&'_ u32> for Float[src]

impl RemFrom<&'_ u32> for Integer[src]

impl RemFrom<&'_ u64> for Float[src]

impl RemFrom<&'_ u64> for Integer[src]

impl RemFrom<&'_ u128> for Float[src]

impl RemFrom<&'_ u128> for Integer[src]

impl RemFrom<&'_ Float> for Float[src]

impl RemFrom<&'_ Integer> for Integer[src]

impl RemFrom<f32> for Float[src]

impl RemFrom<f64> for Float[src]

impl RemFrom<i8> for Float[src]

impl RemFrom<i8> for Integer[src]

impl RemFrom<i16> for Float[src]

impl RemFrom<i16> for Integer[src]

impl RemFrom<i32> for Float[src]

impl RemFrom<i32> for Integer[src]

impl RemFrom<i64> for Float[src]

impl RemFrom<i64> for Integer[src]

impl RemFrom<i128> for Float[src]

impl RemFrom<i128> for Integer[src]

impl RemFrom<u8> for Float[src]

impl RemFrom<u8> for Integer[src]

impl RemFrom<u16> for Float[src]

impl RemFrom<u16> for Integer[src]

impl RemFrom<u32> for Float[src]

impl RemFrom<u32> for Integer[src]

impl RemFrom<u64> for Float[src]

impl RemFrom<u64> for Integer[src]

impl RemFrom<u128> for Float[src]

impl RemFrom<u128> for Integer[src]

impl RemFrom<Float> for Float[src]

impl RemFrom<Integer> for Integer[src]

Loading content...