Ok - I mean the min/max integer value for a scalar $i at the point where $i-- or $i++ will overflow and fail to return the expected value.
Ah, that's yet another question. First of all, Perl numbers don't "overflow" in the sense that adding 1 to a really big positive number gives you are really small negative number.

Say you have:

$i = 0; $i ++ while forever;
What happens is: If your double has more bits than your integer (a very typical situation, specially in older perls, is having 32 bit integers and 64 bit doubles), there's an interesting situation after the change of representation. 64 bit doubles still have something like 53 bits of precision. So, even with 32 integers, you can still store numbers needing 53 bits without losing precision. And I guess something similar will happen if you have 64 bit integers, and 128 bit doubles.

Abigail


In reply to Re: How to portably determine integer limits? by Abigail-II
in thread How to portably determine integer limits? by Anonymous Monk

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.