sub bcd { local $_ = shift; # enforce two digits $_ = "0$_" while 2 > length; die "too big" unless m{^(\d)(\d)$}; return chr(16*$1 + $2); }
In reply to Re: Binary Coded Decimal
by tobyink
in thread Binary Coded Decimal
by adrce55
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |