I don't mean to put pressure - I just leave this here for anyone.

both of these fail with an infinite loop printing i=10 on linux fedora 30, perl 5.28.2. 10 and 15 are the min numbers to do this.

use bignum (p=>1); for(my $i = 1;$i->blt(15);$i->binc()){ print "i=$i\n"; }
for(my $i = 1;$i<=10;$i++){ print "i=$i\n"; }

this shows to me that it is not the loop or the overloaded increment but that when p=>1 it thinks that it's adding that value divided by 10 or something

my $i = 10; print "1 i=$i\n"; $i++; print "2 i=$i\n"; $i = $i + 1; print "3 i=$i\n"; $i = $i + 2; print "4 i=$i\n"; $i = $i + 3; print "5 i=$i\n"; $i = $i + 4; print "6 i=$i\n"; $i = $i + 5; print "7 i=$i\n"; $i = $i + 6 ; print "8 i=$i\n";
1 i=10 2 i=10 3 i=10 4 i=10 5 i=10 6 i=10 7 i=20 8 i=30

I have filed a bug to bigint


In reply to Re^5: Why am I losing accuracy? by bliako
in thread Why am I losing accuracy? 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.