Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How turn a huge decimal number to binary

by lidden (Curate)
on Sep 29, 2007 at 19:57 UTC ( [id://641723] : note . print w/replies, xml ) Need Help??


in reply to How turn a huge decimal number to binary

This should work:
#!/usr/bin/perl -w use strict; use Math::BigInt; my $number = '38562959738576293875632496'; my $n = Math::BigInt->new($number); print $n->as_bin(), "\n";
You may want to remove the '0b' prefix though.