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?

$ perl $\="\n"; print log(3**34)/log(2); use integer; print int(3**34); __END__ 53.8887250245193 16677181699666570

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
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

°) or more likely never have been properly implemented in the first place, because it was developped and tested on 32bit machines