Use Self::BITS
in log2
implementation
This commit is contained in:
parent
1d13de6867
commit
6b5acf0d40
1 changed files with 1 additions and 1 deletions
|
@ -465,7 +465,7 @@ macro_rules! nonzero_unsigned_operations {
|
||||||
without modifying the original"]
|
without modifying the original"]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn log2(self) -> u32 {
|
pub const fn log2(self) -> u32 {
|
||||||
<$Int>::BITS - 1 - self.leading_zeros()
|
Self::BITS - 1 - self.leading_zeros()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the base 10 logarithm of the number, rounded down.
|
/// Returns the base 10 logarithm of the number, rounded down.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue