Trait malachite_base::num::arithmetic::traits::ShrRoundAssign
source · [−]pub trait ShrRoundAssign<RHS> {
fn shr_round_assign(&mut self, other: RHS, rm: RoundingMode);
}
Expand description
Right-shifts a number (divides it by a power of 2) in place, rounding the result according to a specified rounding mode.
Rounding might only be necessary if other
is positive.
Required Methods
fn shr_round_assign(&mut self, other: RHS, rm: RoundingMode)
Implementations on Foreign Types
sourceimpl ShrRoundAssign<u8> for u8
impl ShrRoundAssign<u8> for u8
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for u8
impl ShrRoundAssign<u16> for u8
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for u8
impl ShrRoundAssign<u32> for u8
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for u8
impl ShrRoundAssign<u64> for u8
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for u8
impl ShrRoundAssign<u128> for u8
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for u8
impl ShrRoundAssign<usize> for u8
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for u16
impl ShrRoundAssign<u8> for u16
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for u16
impl ShrRoundAssign<u16> for u16
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for u16
impl ShrRoundAssign<u32> for u16
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for u16
impl ShrRoundAssign<u64> for u16
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for u16
impl ShrRoundAssign<u128> for u16
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for u16
impl ShrRoundAssign<usize> for u16
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for u32
impl ShrRoundAssign<u8> for u32
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for u32
impl ShrRoundAssign<u16> for u32
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for u32
impl ShrRoundAssign<u32> for u32
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for u32
impl ShrRoundAssign<u64> for u32
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for u32
impl ShrRoundAssign<u128> for u32
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for u32
impl ShrRoundAssign<usize> for u32
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for u64
impl ShrRoundAssign<u8> for u64
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for u64
impl ShrRoundAssign<u16> for u64
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for u64
impl ShrRoundAssign<u32> for u64
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for u64
impl ShrRoundAssign<u64> for u64
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for u64
impl ShrRoundAssign<u128> for u64
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for u64
impl ShrRoundAssign<usize> for u64
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for u128
impl ShrRoundAssign<u8> for u128
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for u128
impl ShrRoundAssign<u16> for u128
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for u128
impl ShrRoundAssign<u32> for u128
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for u128
impl ShrRoundAssign<u64> for u128
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for u128
impl ShrRoundAssign<u128> for u128
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for u128
impl ShrRoundAssign<usize> for u128
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for usize
impl ShrRoundAssign<u8> for usize
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for usize
impl ShrRoundAssign<u16> for usize
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for usize
impl ShrRoundAssign<u32> for usize
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for usize
impl ShrRoundAssign<u64> for usize
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for usize
impl ShrRoundAssign<u128> for usize
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for usize
impl ShrRoundAssign<usize> for usize
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for i8
impl ShrRoundAssign<u8> for i8
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for i8
impl ShrRoundAssign<u16> for i8
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for i8
impl ShrRoundAssign<u32> for i8
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for i8
impl ShrRoundAssign<u64> for i8
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for i8
impl ShrRoundAssign<u128> for i8
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for i8
impl ShrRoundAssign<usize> for i8
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for i16
impl ShrRoundAssign<u8> for i16
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for i16
impl ShrRoundAssign<u16> for i16
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for i16
impl ShrRoundAssign<u32> for i16
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for i16
impl ShrRoundAssign<u64> for i16
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for i16
impl ShrRoundAssign<u128> for i16
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for i16
impl ShrRoundAssign<usize> for i16
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for i32
impl ShrRoundAssign<u8> for i32
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for i32
impl ShrRoundAssign<u16> for i32
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for i32
impl ShrRoundAssign<u32> for i32
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for i32
impl ShrRoundAssign<u64> for i32
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for i32
impl ShrRoundAssign<u128> for i32
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for i32
impl ShrRoundAssign<usize> for i32
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for i64
impl ShrRoundAssign<u8> for i64
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for i64
impl ShrRoundAssign<u16> for i64
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for i64
impl ShrRoundAssign<u32> for i64
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for i64
impl ShrRoundAssign<u64> for i64
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for i64
impl ShrRoundAssign<u128> for i64
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for i64
impl ShrRoundAssign<usize> for i64
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for i128
impl ShrRoundAssign<u8> for i128
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for i128
impl ShrRoundAssign<u16> for i128
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for i128
impl ShrRoundAssign<u32> for i128
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for i128
impl ShrRoundAssign<u64> for i128
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for i128
impl ShrRoundAssign<u128> for i128
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for i128
impl ShrRoundAssign<usize> for i128
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u8> for isize
impl ShrRoundAssign<u8> for isize
sourcefn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u16> for isize
impl ShrRoundAssign<u16> for isize
sourcefn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u32> for isize
impl ShrRoundAssign<u32> for isize
sourcefn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u64> for isize
impl ShrRoundAssign<u64> for isize
sourcefn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<u128> for isize
impl ShrRoundAssign<u128> for isize
sourcefn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: u128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<usize> for isize
impl ShrRoundAssign<usize> for isize
sourcefn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: usize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if rm
is RoundingMode::Exact
but self
is not divisible by
$2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for u8
impl ShrRoundAssign<i8> for u8
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for u8
impl ShrRoundAssign<i16> for u8
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for u8
impl ShrRoundAssign<i32> for u8
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for u8
impl ShrRoundAssign<i64> for u8
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for u8
impl ShrRoundAssign<i128> for u8
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for u8
impl ShrRoundAssign<isize> for u8
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for u16
impl ShrRoundAssign<i8> for u16
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for u16
impl ShrRoundAssign<i16> for u16
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for u16
impl ShrRoundAssign<i32> for u16
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for u16
impl ShrRoundAssign<i64> for u16
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for u16
impl ShrRoundAssign<i128> for u16
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for u16
impl ShrRoundAssign<isize> for u16
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for u32
impl ShrRoundAssign<i8> for u32
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for u32
impl ShrRoundAssign<i16> for u32
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for u32
impl ShrRoundAssign<i32> for u32
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for u32
impl ShrRoundAssign<i64> for u32
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for u32
impl ShrRoundAssign<i128> for u32
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for u32
impl ShrRoundAssign<isize> for u32
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for u64
impl ShrRoundAssign<i8> for u64
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for u64
impl ShrRoundAssign<i16> for u64
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for u64
impl ShrRoundAssign<i32> for u64
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for u64
impl ShrRoundAssign<i64> for u64
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for u64
impl ShrRoundAssign<i128> for u64
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for u64
impl ShrRoundAssign<isize> for u64
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for u128
impl ShrRoundAssign<i8> for u128
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for u128
impl ShrRoundAssign<i16> for u128
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for u128
impl ShrRoundAssign<i32> for u128
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for u128
impl ShrRoundAssign<i64> for u128
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for u128
impl ShrRoundAssign<i128> for u128
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for u128
impl ShrRoundAssign<isize> for u128
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for usize
impl ShrRoundAssign<i8> for usize
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for usize
impl ShrRoundAssign<i16> for usize
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for usize
impl ShrRoundAssign<i32> for usize
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for usize
impl ShrRoundAssign<i64> for usize
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for usize
impl ShrRoundAssign<i128> for usize
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for usize
impl ShrRoundAssign<isize> for usize
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for i8
impl ShrRoundAssign<i8> for i8
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for i8
impl ShrRoundAssign<i16> for i8
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for i8
impl ShrRoundAssign<i32> for i8
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for i8
impl ShrRoundAssign<i64> for i8
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for i8
impl ShrRoundAssign<i128> for i8
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for i8
impl ShrRoundAssign<isize> for i8
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for i16
impl ShrRoundAssign<i8> for i16
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for i16
impl ShrRoundAssign<i16> for i16
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for i16
impl ShrRoundAssign<i32> for i16
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for i16
impl ShrRoundAssign<i64> for i16
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for i16
impl ShrRoundAssign<i128> for i16
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for i16
impl ShrRoundAssign<isize> for i16
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for i32
impl ShrRoundAssign<i8> for i32
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for i32
impl ShrRoundAssign<i16> for i32
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for i32
impl ShrRoundAssign<i32> for i32
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for i32
impl ShrRoundAssign<i64> for i32
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for i32
impl ShrRoundAssign<i128> for i32
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for i32
impl ShrRoundAssign<isize> for i32
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for i64
impl ShrRoundAssign<i8> for i64
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for i64
impl ShrRoundAssign<i16> for i64
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for i64
impl ShrRoundAssign<i32> for i64
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for i64
impl ShrRoundAssign<i64> for i64
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for i64
impl ShrRoundAssign<i128> for i64
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for i64
impl ShrRoundAssign<isize> for i64
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for i128
impl ShrRoundAssign<i8> for i128
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for i128
impl ShrRoundAssign<i16> for i128
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for i128
impl ShrRoundAssign<i32> for i128
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for i128
impl ShrRoundAssign<i64> for i128
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for i128
impl ShrRoundAssign<i128> for i128
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for i128
impl ShrRoundAssign<isize> for i128
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i8> for isize
impl ShrRoundAssign<i8> for isize
sourcefn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i8, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i16> for isize
impl ShrRoundAssign<i16> for isize
sourcefn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i16, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i32> for isize
impl ShrRoundAssign<i32> for isize
sourcefn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i32, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i64> for isize
impl ShrRoundAssign<i64> for isize
sourcefn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i64, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<i128> for isize
impl ShrRoundAssign<i128> for isize
sourcefn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: i128, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.
sourceimpl ShrRoundAssign<isize> for isize
impl ShrRoundAssign<isize> for isize
sourcefn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
fn shr_round_assign(&mut self, bits: isize, rm: RoundingMode)
Shifts a number right (divides it by a power of 2) and rounds according to the specified rounding mode, in place.
Passing RoundingMode::Floor
or RoundingMode::Down
is equivalent to
using >>
. To test whether RoundingMode::Exact
can be passed, use
self.divisible_by_power_of_2(bits)
. Rounding might only be necessary if
bits
is non-negative.
See the ShrRound
documentation for details.
Worst-case complexity
Constant time and additional memory.
Panics
Panics if bits
is positive and rm
is RoundingMode::Exact
but self
is
not divisible by $2^b$.
Examples
See here.