$ perl -le ' > vec($str, $_, 1) = 1 for 1, 8, 9; > $high = unpack q{xc}, $str; > $low = unpack q{c}, $str; > print qq{$high - $low};' 3 - 2 $
Cheers,
JohnGG
In reply to Re: Making two 8-bit numbers from indices of set bits
by johngg
in thread Making two 8-bit numbers from indices of set bits
by carcassonne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |