pub struct NumberUnderMod { /* private fields */ }Expand description
NumberUnderMod represents a number under a certain modulus.
This struct provides methods for performing arithmetic operations (addition, subtraction, multiplication, division, and negation) under the modulus.
§Examples
let num1 = NumberUnderMod::new(5, 7); let num2 = NumberUnderMod::new(3, 7); let result = num1 + num2; assert_eq!(result.unwrap().value, 1);
Implementations§
Trait Implementations§
Source§impl Add for NumberUnderMod
impl Add for NumberUnderMod
Source§impl Debug for NumberUnderMod
impl Debug for NumberUnderMod
Source§impl Div for NumberUnderMod
impl Div for NumberUnderMod
Source§impl Mul for NumberUnderMod
impl Mul for NumberUnderMod
Source§impl Neg for NumberUnderMod
impl Neg for NumberUnderMod
Source§impl PartialEq for NumberUnderMod
impl PartialEq for NumberUnderMod
Auto Trait Implementations§
impl Freeze for NumberUnderMod
impl RefUnwindSafe for NumberUnderMod
impl Send for NumberUnderMod
impl Sync for NumberUnderMod
impl Unpin for NumberUnderMod
impl UnwindSafe for NumberUnderMod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more