Function bitwise::word::flip_bits_leq [] [src]

pub fn flip_bits_leq<T: Word, U: UnsignedWord>(x: T, bit: U) -> T

Flips all bits of x at position <= bit.

Panics

If bit >= bit_size().

Examples

use bitwise::word::*;

let n = 0b1011_0010u8;
let s = 0b1000_1101u8;
assert_eq!(n.flip_bits_leq(5u8), s);
assert_eq!(flip_bits_leq(n, 5u8), s);