diff --git a/bigint/src/biguint.rs b/bigint/src/biguint.rs index a21b5cd..dd0de5b 100644 --- a/bigint/src/biguint.rs +++ b/bigint/src/biguint.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use std::default::Default; use std::iter::repeat; -use std::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Neg, Rem, Shl, Shr, Sub, AddAssign, SubAssign, MulAssign}; +use std::ops::{Add, BitAnd, BitOr, BitXor, Div, Mul, Neg, Rem, Shl, Shr, Sub, AddAssign, SubAssign, MulAssign, DivAssign}; use std::str::{self, FromStr}; use std::fmt; use std::cmp; @@ -635,6 +635,12 @@ impl<'a, 'b> Div<&'b BigUint> for &'a BigUint { q } } +impl<'a> DivAssign<&'a BigUint> for BigUint { + #[inline] + fn div_assign(&mut self, other: &'a BigUint) { + *self = &*self / other; + } +} promote_unsigned_scalars!(impl Div for BigUint, div); forward_all_scalar_binop_to_val_val!(impl Div for BigUint, div); @@ -649,6 +655,12 @@ impl Div for BigUint { q } } +impl DivAssign for BigUint { + #[inline] + fn div_assign(&mut self, other: BigDigit) { + *self = &*self / other; + } +} impl Div for BigDigit { type Output = BigUint; @@ -672,6 +684,12 @@ impl Div for BigUint { q } } +impl DivAssign for BigUint { + #[inline] + fn div_assign(&mut self, other: DoubleBigDigit) { + *self = &*self / other; + } +} impl Div for DoubleBigDigit { type Output = BigUint;