in reply to Re^3: decimal to binary conversion need help
in thread decimal to binary conversion need help

Oops, I guess BigInt wants a string, not a number.
my $bignum = Math::BigInt->new('9007199254740991'); print $bignum->as_bin(),"\n"; ######################################################## use bigint; my $bignum = 9007199254740991; print $bignum->as_bin(),"\n";
#Correct results:
0b11111111111111111111111111111111111111111111111111111 0b11111111111111111111111111111111111111111111111111111

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^5: decimal to binary conversion need help
by Anonymous Monk on Jan 06, 2005 at 13:29 UTC
    Thank you for all this help, but i have another problem i am running the code on perl 5.6 and it seems that it is not working please help
      what is the error message?
      i donīt know if Math::BigInt.pm or bigint.pm is a perl 5.6 core module. if not then install it.