in reply to How turn a huge decimal number to binary
Within the limitations of doubles to represent large numbers accurately, you can do this by breaking the number into hi and lo integers, converting them separately, and concatenating the results:
$huge = 1024**4;; $lo = $huge % 2**32;; $hi = int( $huge / 2**32 );; printf "%b%032b\n", $hi, $lo;; 10000000000000000000000000000000000000000
Otherwise take a look at the bigint pragma and Math::BigInt.
|
|---|