in reply to "force string context"?

If you need to handle integers bigger than 2**31 (> 2147483646) you should use Math::BigInt. Is just not recomended to work with numbers outside of the range, will just not work!

Graciliano M. P.
"Creativity is the expression of the liberty".

Replies are listed 'Best First'.
Re: "force string context"?
by Abigail-II (Bishop) on Apr 16, 2004 at 11:25 UTC
    If you need to handle integers bigger than 2**31 (> 2147483646) you should use Math::BigInt
    If your integers are less than about 2**51, there will be no loss of significant digits (because Perl will automatically start using doubles). If your integers will be less than 2**63, I'd prefer a 64int perl over Math::BigInt. (In fact, I always compile my perls to turn on 64 bit integer support).

    Abigail

      But to use 64int I need a 64bit CPU?

      And what is the option to enable that? I never compiled in this way and I'm interested to make some tests.

      Graciliano M. P.
      "Creativity is the expression of the liberty".

        But to use 64int I need a 64bit CPU?
        No, all you need is a compiler being able to deal with it.

        For compiling options, please read the INSTALL, README and README.<your OS> files that come with the source.

        Abigail