in reply to Hex/binary/Decimal
shows the result like this:my $hex = hex("1c023d64"); my $mask = 31 << 5; my $result = ($hex & $mask) >> 5; printf "Hex: %30b\n", $hex; printf "Mask: %30b\n", $mask; printf "Result: %30b (%d)\n", $result, $result;
Hex: 11100000000100011110101100100 Mask: 1111100000 Result: 1011 (11)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hex/binary/Decimal
by thekestrel (Friar) on Feb 11, 2005 at 23:21 UTC |