Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to do some mathematical operations, but my numbers are mistreated.

For example:.
123 ** 17 should be: 337587917446653715596592958817679803

But in PERL it isn't. So, how do I approach this. Maybe with Math:BigInt? But, it doesn't seem to work (I get NaN (not a number) stuff). I need detailed instructions, since I'm a dummy and all.

Replies are listed 'Best First'.
Re: My numbers are rounded down...
by Dog and Pony (Priest) on Jun 08, 2002 at 14:36 UTC
    Looking at the docs of Math::BigInt, this should do it:
    perl -MMath::BigInt=:constant -e "print 123**17"
    Which is the same thing as:
    use Math::BigInt ':constant'; print 123**17;
    Hope that helps. :)
    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.
Re: My numbers are rounded down...
by crazyinsomniac (Prior) on Jun 09, 2002 at 00:23 UTC