Help for this page

Select Code to Download


  1. or download this
    use Bit::Manip qw(:all);
    use Test::More;
    ...
    }
    
    ... # your subs go below, not quoted here...
    
  2. or download this
    #       INPUT           VAL             DESIRED OUTPUT
    #       0bKKKK_KKKK     0b0000_0000     0bKKK0_K000
    ...
    for (0 .. 15) {
        is( bit_set_skip( 0x00, [0,1,2,4], $_), (($_ & 0x08)<<1) | (($_ & 
    +0x07)<<0), "put a gap between the MSB and the lower three bits");
    }