See pack/unpack for more details. You need other types for floats ('b128','d') or other integer types.print unpack('b32',pack('L',$num));
Hope this helps,
Jeroen
"We are not alone"(FZ)
Update: Noticed the posts of tadman and stefan_k. From stefan_k's link I understand that binary sprintf is only available in perl 5.6 or higher.
In reply to Re: decimal to binary
by jeroenes
in thread decimal to binary
by tsvika_t
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |