pub trait CeilingRootAssign<POW> {
// Required method
fn ceiling_root_assign(&mut self, pow: POW);
}Expand description
Replaces a number with the ceiling of its $n$th root.
Required Methods§
fn ceiling_root_assign(&mut self, pow: POW)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl CeilingRootAssign<u64> for i8
impl CeilingRootAssign<u64> for i8
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for i16
impl CeilingRootAssign<u64> for i16
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for i32
impl CeilingRootAssign<u64> for i32
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for i64
impl CeilingRootAssign<u64> for i64
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for i128
impl CeilingRootAssign<u64> for i128
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for isize
impl CeilingRootAssign<u64> for isize
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for u8
impl CeilingRootAssign<u64> for u8
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for u16
impl CeilingRootAssign<u64> for u16
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for u32
impl CeilingRootAssign<u64> for u32
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for u64
impl CeilingRootAssign<u64> for u64
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for u128
impl CeilingRootAssign<u64> for u128
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.
Source§impl CeilingRootAssign<u64> for usize
impl CeilingRootAssign<u64> for usize
Source§fn ceiling_root_assign(&mut self, exp: u64)
fn ceiling_root_assign(&mut self, exp: u64)
Replaces an integer with the ceiling of its $n$th root.
$x \gets \lceil\sqrt[n]{x}\rceil$.
§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():
constant for widths up to 64 bits and for exponents greater than 2, where a
floating-point approximation is refined with $O(1)$ adjustments; 128-bit square
roots (exp == 2) fall back to an $O(n)$ binary search.
§Panics
Panics if exp is zero, or if self is negative and exp is even.
§Examples
See here.