![]() |
|
"be consistent" | |
PerlMonks |
integer pragma buggy? (ANSWERED)by LanX (Saint) |
on Jun 02, 2025 at 22:14 UTC ( [id://11165215]=perlquestion: print w/replies, xml ) | Need Help?? |
LanX has asked for the wisdom of the Perl Monks concerning the following question:
(in continuation to Re^7: Largest integer in 64-bit perl (RFC)) According to integer it'll adjust the ** operation to integer, even on 64bit machines. This seems to break as soon as the precision of floats at 53bits is exceeded° Am I missing something?
NB: a power to the basis 3 can't ever be even (odd*odd is odd) and the correct number is 16677181699666569 according to Math::BigInt ...
To answer my own question ...... it's documented, doh. > The power operator ** is also not affected, I was confused by the fact that the synopsis explicitly shows the power operator. > $a = 2**31 - 1; # Largest positive integer on 32-bit machines Honestly I thing integer is far too incomplete to be of big use.
Cheers Rolf
°) or more likely never have been properly implemented in the first place, because it was developped and tested on 32bit machines
Back to
Seekers of Perl Wisdom
|
|