pub trait RemovePowerAssign<RHS = Self> {
// Required method
fn remove_power_assign(&mut self, other: RHS) -> u64;
}Expand description
A trait for replacing a number with itself divided by the largest power of a factor, returning how many times the factor was removed.
Required Methods§
fn remove_power_assign(&mut self, other: RHS) -> u64
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl RemovePowerAssign for i8
impl RemovePowerAssign for i8
Source§fn remove_power_assign(&mut self, other: i8) -> u64
fn remove_power_assign(&mut self, other: i8) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for i16
impl RemovePowerAssign for i16
Source§fn remove_power_assign(&mut self, other: i16) -> u64
fn remove_power_assign(&mut self, other: i16) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for i32
impl RemovePowerAssign for i32
Source§fn remove_power_assign(&mut self, other: i32) -> u64
fn remove_power_assign(&mut self, other: i32) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for i64
impl RemovePowerAssign for i64
Source§fn remove_power_assign(&mut self, other: i64) -> u64
fn remove_power_assign(&mut self, other: i64) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for i128
impl RemovePowerAssign for i128
Source§fn remove_power_assign(&mut self, other: i128) -> u64
fn remove_power_assign(&mut self, other: i128) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for isize
impl RemovePowerAssign for isize
Source§fn remove_power_assign(&mut self, other: isize) -> u64
fn remove_power_assign(&mut self, other: isize) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for u8
impl RemovePowerAssign for u8
Source§fn remove_power_assign(&mut self, other: u8) -> u64
fn remove_power_assign(&mut self, other: u8) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for u16
impl RemovePowerAssign for u16
Source§fn remove_power_assign(&mut self, other: u16) -> u64
fn remove_power_assign(&mut self, other: u16) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for u32
impl RemovePowerAssign for u32
Source§fn remove_power_assign(&mut self, other: u32) -> u64
fn remove_power_assign(&mut self, other: u32) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for u64
impl RemovePowerAssign for u64
Source§fn remove_power_assign(&mut self, other: u64) -> u64
fn remove_power_assign(&mut self, other: u64) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for u128
impl RemovePowerAssign for u128
Source§fn remove_power_assign(&mut self, other: u128) -> u64
fn remove_power_assign(&mut self, other: u128) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.
Source§impl RemovePowerAssign for usize
impl RemovePowerAssign for usize
Source§fn remove_power_assign(&mut self, other: usize) -> u64
fn remove_power_assign(&mut self, other: usize) -> u64
Divides a number by the largest power of a factor that divides it, in place, returning the exponent of that power.
The factor need not be prime. Zero is left alone, with an exponent of 0.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is self.significant_bits():
each division by other, which is at least 2, removes at least one bit.
§Panics
Panics if other is 0 or 1, or, for signed types, -1.
§Examples
See here.