Trait malachite_base::num::arithmetic::traits::DivExactAssign
source · [−]pub trait DivExactAssign<RHS = Self> {
fn div_exact_assign(&mut self, other: RHS);
}
Expand description
Divides a number by another number in place, assuming the first exactly divides the second.
If it doesn’t, this function may panic or assign a meaningless number to the first number.
Required Methods
fn div_exact_assign(&mut self, other: RHS)
Implementations on Foreign Types
sourceimpl DivExactAssign<u8> for u8
impl DivExactAssign<u8> for u8
sourcefn div_exact_assign(&mut self, other: u8)
fn div_exact_assign(&mut self, other: u8)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<u16> for u16
impl DivExactAssign<u16> for u16
sourcefn div_exact_assign(&mut self, other: u16)
fn div_exact_assign(&mut self, other: u16)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<u32> for u32
impl DivExactAssign<u32> for u32
sourcefn div_exact_assign(&mut self, other: u32)
fn div_exact_assign(&mut self, other: u32)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<u64> for u64
impl DivExactAssign<u64> for u64
sourcefn div_exact_assign(&mut self, other: u64)
fn div_exact_assign(&mut self, other: u64)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<u128> for u128
impl DivExactAssign<u128> for u128
sourcefn div_exact_assign(&mut self, other: u128)
fn div_exact_assign(&mut self, other: u128)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<usize> for usize
impl DivExactAssign<usize> for usize
sourcefn div_exact_assign(&mut self, other: usize)
fn div_exact_assign(&mut self, other: usize)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<i8> for i8
impl DivExactAssign<i8> for i8
sourcefn div_exact_assign(&mut self, other: i8)
fn div_exact_assign(&mut self, other: i8)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<i16> for i16
impl DivExactAssign<i16> for i16
sourcefn div_exact_assign(&mut self, other: i16)
fn div_exact_assign(&mut self, other: i16)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<i32> for i32
impl DivExactAssign<i32> for i32
sourcefn div_exact_assign(&mut self, other: i32)
fn div_exact_assign(&mut self, other: i32)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<i64> for i64
impl DivExactAssign<i64> for i64
sourcefn div_exact_assign(&mut self, other: i64)
fn div_exact_assign(&mut self, other: i64)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<i128> for i128
impl DivExactAssign<i128> for i128
sourcefn div_exact_assign(&mut self, other: i128)
fn div_exact_assign(&mut self, other: i128)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.
sourceimpl DivExactAssign<isize> for isize
impl DivExactAssign<isize> for isize
sourcefn div_exact_assign(&mut self, other: isize)
fn div_exact_assign(&mut self, other: isize)
Divides a value by another value in place. The value being assigned to must be exactly divisible by the value on the right-hand side.
If self
is not exactly divisible by other
, this function may panic or return a
meaningless result.
$$ x \gets \frac{x}{y}. $$
If you are unsure whether the division will be exact, use self /= other
instead.
If you’re unsure and you want to know, use self.div_assign_mod(other)
and check
whether the remainder is zero. If you want a function that panics if the division
is not exact, use self.div_round_assign(other, RoundingMode::Exact)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if other
is zero or if self
is Self::MIN
and other is -1.
Examples
See here.