in reply to about int's

Use Math::BigInt to let them grow unboundedly. (This module underwent a major rewrite at one point. Use the version shipped with perl 5.8 or later; for earlier perl versions, get a copy from CPAN).

Normally, perl uses a 32 or 64 bit signed integer (depending on platform and Configure options), promoting it to a floating point value (usually with 53 or 64 bits of mantissa)/ as needed. To stretch just a little extra range for integers, perl will sometimes use an unsigned integer instead of a signed one.

Replies are listed 'Best First'.
Re: Re: about int's
by bart (Canon) on Nov 09, 2003 at 14:35 UTC
    Oh, and when using Math::BigInt, do make sure you're using one of those lower level supporting XS libraries, or it'll be damn slow — all lower level calculations being done in Pure Perl. I'm not sure if the Math::BigInt that comes with 5.8 is that smart by itself, but older versions definitely weren't.

    See the Math::BigInt docs for more info. No, it doesn't look like it's gotten any smarter.

      Even with one of the XS libraries, it'll be a lot slower.