Update: I forgot to mention that oct() can be used (in Perl 5.6.0) to convert from binary to decimal:print bin2dec(0b1101) . "\n"; print dec2bin(13) . "\n"; sub bin2dec { return(sprintf "%d",shift); } sub dec2bin { return(sprintf "%b",shift); }
perl -e 'print oct("0b1101") . "\n";'
In reply to RE: decimal to binary
by dempa
in thread decimal to binary
by Punto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |