Function bitfrob::u8_get_bit
source · pub const fn u8_get_bit(b: u32, u: u8) -> bool
Expand description
Determines if the b
bit is set in u
.
Panics
b
can’t exceed the number of bits in the type.
assert_eq!(u8_get_bit(0, 0b0000_1110_u8), false);
assert_eq!(u8_get_bit(1, 0b0000_1110_u8), true);