doc.rust-lang.org
pub const fn rotate_left(self, n: u32) -> Self
Shifts the bits to the left by a specified amount, n, saturating the truncated bits to the end of the resulting integer.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn reverse_bits(self) -> Self
Reverses the bit pattern of the integer.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn pow(self, exp: u32) -> Self
Raises self to the power of exp, using exponentiation by squaring.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of self.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_power_of_two(self) -> bool
Returns true if and only if self == 2^k for some k.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_positive(self) -> bool
Returns true if self is positive and false if the number is zero or negative.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn is_negative(self) -> bool
Returns true if self is negative and false if the number is zero or positive.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_le(x: Self) -> Self
Converts an integer from little endian to the target's endianness.
associated_function
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn from_be(x: Self) -> Self
Converts an integer from big endian to the target's endianness.
associated_function
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn abs(self) -> Saturating<isize>
Saturating absolute value. Computes self.abs(), returning MAX if self == MIN instead of overflowing.
method
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
const MIN: Self
Returns the smallest value that can be represented by this integer type.
associated_constant
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
const MAX: Self
Returns the largest value that can be represented by this integer type.
associated_constant
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
const BITS: u32
Returns the size of this integer type in bits.
associated_constant
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Saturating<T>
Provides intentionally-saturating arithmetic on T.
struct
core
Stable since 1.74.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroUsize = NonZero<usize>
A usize that is known not to equal zero.
type_alias
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroU8 = NonZero<u8>
A u8 that is known not to equal zero.
type_alias
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroU64 = NonZero<u64>
A u64 that is known not to equal zero.
type_alias
core
Stable since 1.28.0
Version 1.100.0-nightly
doc.rust-lang.org
pub type NonZeroU32 = NonZero<u32>
A u32 that is known not to equal zero.
type_alias
core
Stable since 1.28.0
Version 1.100.0-nightly