Subject: | BigInt wraps largest signed integer |
Doing an operation that results in something beyond the largest signed integer results in undefined behavior in C. perl currently sets an option to gcc and other compilers to treat this as described in the man page
-fwrapv
This option instructs the compiler to assume that signed arithmetic
overflow of addition, subtraction and multiplication wraps around
using twos-complement representation.
This is a temporary kludge, because it is likely obscuring an underlying bug. I compiled 5.27.10 so that wrapv is not in effect (You can do this by passing this to Configure
-Accflags='-ftrapv' -Accflags='-fno-wrapv'
and found that all the Math-Bigfoo modules failed, for example
../cpan/Math-BigInt-FastCalc/t/bigintfc.t ..........................
Failed 359/359 subtests
The 5.29 series is likely to to remove this kludge, and the Bigfoo functions will start failing then. But, again this is likely hiding an existing bug.
The core perl bug is
https://rt.perl.org/Ticket/Display.html?id=121505