Trait ndarray_rand::rand_distr::num_traits::WrappingShr [−][src]
Performs a right shift that does not panic.
Required methods
pub fn wrapping_shr(&self, rhs: u32) -> Self
[src]
Panic-free bitwise shift-right; yields self >> mask(rhs)
,
where mask
removes any high order bits of rhs
that would
cause the shift to exceed the bitwidth of the type.
use num_traits::WrappingShr; let x: u16 = 0x8000; assert_eq!(WrappingShr::wrapping_shr(&x, 0), 0x8000); assert_eq!(WrappingShr::wrapping_shr(&x, 1), 0x4000); assert_eq!(WrappingShr::wrapping_shr(&x, 15), 0x0001); assert_eq!(WrappingShr::wrapping_shr(&x, 16), 0x8000);
Implementations on Foreign Types
impl WrappingShr for i32
[src]
pub fn wrapping_shr(&self, rhs: u32) -> i32
[src]
impl WrappingShr for u32
[src]
pub fn wrapping_shr(&self, rhs: u32) -> u32
[src]
impl WrappingShr for i64
[src]
pub fn wrapping_shr(&self, rhs: u32) -> i64
[src]
impl WrappingShr for u16
[src]
pub fn wrapping_shr(&self, rhs: u32) -> u16
[src]
impl WrappingShr for i16
[src]
pub fn wrapping_shr(&self, rhs: u32) -> i16
[src]
impl WrappingShr for u128
[src]
pub fn wrapping_shr(&self, rhs: u32) -> u128
[src]
impl WrappingShr for isize
[src]
pub fn wrapping_shr(&self, rhs: u32) -> isize
[src]
impl WrappingShr for usize
[src]
pub fn wrapping_shr(&self, rhs: u32) -> usize
[src]
impl<T> WrappingShr for Wrapping<T> where
T: WrappingShr,
Wrapping<T>: Shr<usize>,
<Wrapping<T> as Shr<usize>>::Output == Wrapping<T>,
[src]
T: WrappingShr,
Wrapping<T>: Shr<usize>,
<Wrapping<T> as Shr<usize>>::Output == Wrapping<T>,