use strict; use warnings; my @indicies = qw(8 1 9); my $code; $code |= 1 << $_ for @indicies; printf "0x%02X 0x%02X\n", $code >> 8, $code & 0xFF;
Prints:
0x03 0x02
In reply to Re: Making two 8-bit numbers from indices of set bits
by GrandFather
in thread Making two 8-bit numbers from indices of set bits
by carcassonne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |