Trait malachite_base::num::arithmetic::traits::DivExactAssign
source · pub trait DivExactAssign<RHS = Self> {
// Required method
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§
source§impl DivExactAssign for i8
impl DivExactAssign for i8
source§fn 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, 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.
source§impl DivExactAssign for i16
impl DivExactAssign for i16
source§fn 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, 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.
source§impl DivExactAssign for i32
impl DivExactAssign for i32
source§fn 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, 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.
source§impl DivExactAssign for i64
impl DivExactAssign for i64
source§fn 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, 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.
source§impl DivExactAssign for i128
impl DivExactAssign for i128
source§fn 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, 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.
source§impl DivExactAssign for isize
impl DivExactAssign for isize
source§fn 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, 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.
source§impl DivExactAssign for u8
impl DivExactAssign for u8
source§fn 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, 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.
source§impl DivExactAssign for u16
impl DivExactAssign for u16
source§fn 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, 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.
source§impl DivExactAssign for u32
impl DivExactAssign for u32
source§fn 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, 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.
source§impl DivExactAssign for u64
impl DivExactAssign for u64
source§fn 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, 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.
source§impl DivExactAssign for u128
impl DivExactAssign for u128
source§fn 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, 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.
source§impl DivExactAssign for usize
impl DivExactAssign for usize
source§fn 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, 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.