My version actually started out in my head closer to:
my $mask= 0x0f000007; my $val= 0; do { printf "0x%08.8x\n", $val & $mask; $val |= ~$mask; ++$val; } while( $val <= ~0 );
but in typing it I decided to simplify. (:
- tye
In reply to Re^2: Incrementing only the masked bits (chicken eggs)
by tye
in thread Incrementing only the masked bits
by lyeoh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |