I get the same with 5.36.0 as I did with 5.26.1.
Oh, I see. You were adding powers of 2 to the original value of 2**64.
I get the same as you when I run the code you provided.
I was incrementing by one:
D:\>perl -MMath::BigInt -wle "$x = Math::BigInt->new(~0); $x++; while(
+\"$x\" == ~0){$x++}; print $x;"
18446744073709553665
Of course, this particular perl configuration sees 18446744073709553665 and 18446744073709554600 as the same value, anyway:
D:\>perl -le "print 'ok' if 18446744073709553665 == 184467440737095546
+00;"
ok
However, that your 5.26.1 regards 18446744073709554600 and 18446744073709554599 as different values is a bug in 5.26.1. (I see the same bug in my Windows build of 5.26.0.)
I believe that perl should regard those two values as equivalent for all IV and NV configurations.
D:\>perl -wle "print 'ok' if 18446744073709554600 == 18446744073709554
+599;"
ok
For me, that fails to output 'ok' on 5.26.0. (If 5.26.0 has been built with -Duselongdouble, then 5.26.0 does get it right and outputs 'ok'.)
Cheers,
Rob
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.