did someone can do better ? ( I'm sure you can, I trust in you ;)sub to_bin { my( $num , $len ) = ( shift , 0 ); while( $num >> $len ){ $len++ ;} return reverse map {( $num & 1 << $_ ) ? "1" : "0";}(0..$len-1); }
In reply to Re: Re: decimal to binary
by Gloom
in thread decimal to binary
by tsvika_t
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |