Anyway, my question is if Perl is compiled for a 64-bit machine and supports 64-bit integer operations, does it still store numbers same way internally

It's still essentially the same.
Your perl can exactly represent all integers in the range -9007199254740992..9007199254740992.
Integer values in the range -2147483647..4294967295 can be stored as 32-bit integer type (IV), the rest can only be stored as 53-bit (double) precision float type (NV).

If you go to a 64-bit perl that has the double precision NV type, then the range increases to -9223372036854775808..18446744073709551616. All of these integer values (except for 18446744073709551616 and -9223372036854775808, which can only be stored as an NV) can be stored as the integer type (IV). Not all all of them are representable as an NV.

If your perl has an nvtype of 64-bit precision long double, then the range expands to -18446744073709551616..18446744073709551616.
And if your perl has an nvtype of __float128 (or 113-bit precision long double), then the range is -10384593717069655257060992658440192..10384593717069655257060992658440192.

As you can see, except for the 64-bit perl with the 53-bit NV, the range is dependent upon on the NV type, not the IV type.

Cheers,
Rob

In reply to Re: Largest integer in 64-bit perl by syphilis
in thread Largest integer in 64-bit perl by harangzsolt33

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.