doc.rust-lang.org
pub const fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>
Calculates the smallest value greater than or equal to self that is a multiple of rhs. Returns None if rhs is zero or the operation would result in overflow.
method
core
Stable since 1.73.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_neg(self) -> Option<Self>
Checked negation. Computes -self, returning None unless self == 0.
method
core
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_mul(self, rhs: Self) -> Option<Self>
Checked integer multiplication. Computes self * rhs, returning None if overflow occurred.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
method
core
Stable since 1.67.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_ilog10(self) -> Option<u32>
Returns the base 10 logarithm of the number, rounded down.
method
core
Stable since 1.67.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_ilog(self, base: Self) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
method
core
Stable since 1.67.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_div_euclid(self, rhs: Self) -> Option<Self>
Checked Euclidean division. Computes self.div_euclid(rhs), returning None if rhs == 0.
method
core
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_div(self, rhs: Self) -> Option<Self>
Checked integer division. Computes self / rhs, returning None if rhs == 0.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_add_signed(self, rhs: i16) -> Option<Self>
Checked addition with a signed integer. Computes self + rhs, returning None if overflow occurred.
method
core
Stable since 1.66.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn checked_add(self, rhs: Self) -> Option<Self>
Checked integer addition. Computes self + rhs, returning None if overflow occurred.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn cast_signed(self) -> i16
Returns the bit pattern of self reinterpreted as a signed integer of the same size.
method
core
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn carrying_mul_add(self, rhs: Self, carry: Self, add: Self) -> (Self, Self)
Calculates the "full multiplication" self * rhs + carry + add.
method
core
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)
Calculates the "full multiplication" self * rhs + carry without the possibility to overflow.
method
core
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)
Calculates self + rhs + carry and returns a tuple containing the sum and the output carry (in that order).
method
core
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)
Calculates self − rhs − borrow and returns a tuple containing the difference and the output borrow.
method
core
Stable since 1.91.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn bit_width(self) -> u32
Returns the minimum number of bits required to represent self.
method
core
Stable since 1.97.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn abs_diff(self, other: Self) -> Self
Computes the absolute difference between self and other.
method
core
Stable since 1.60.0
Version 1.100.0-nightly
doc.rust-lang.org
const MIN: Self
The smallest value that can be represented by this integer type.
associated_constant
core
Stable since 1.43.0
Version 1.100.0-nightly
doc.rust-lang.org
const MAX: Self
The largest value that can be represented by this integer type (216 − 1).
associated_constant
core
Stable since 1.43.0
Version 1.100.0-nightly
doc.rust-lang.org
const BITS: u32
The size of this integer type in bits.
associated_constant
core
Stable since 1.53.0
Version 1.100.0-nightly