Bug#1732: Bad arithmetic in new perl packages
> : > Perl seems to be confused making some arithmetic operations (additions).
> : > Sometimes the result of $a+=$b, when $a is 0 and $b is 2 happens to be
> : > 2.000004192 or something similar.
> : Fernando, I unfortunately have no idea what is causing this. Please
> : provide a short script which shows this behaviour (reliably if possible).
> : Perl5-porters, is this a known bug?
> No. Another possibility is that the compiler is using single-precision
> instead of double-precision floats. I think you get about 7 digits of
> accuracy in single precision.
Larry, I've forwarded Fernando's script to perl5-porters.
The perl5 package was compiled using Debian's gcc package (gcc 2.6.3)
in a.out binary format using '-O2 -fomit-frame-pointer' optimization;
the libc is Linux libc-4.6.27.
The output differs in the 10th decimal. The weird thing is that it
appears when copying the value.
I cannot reproduce the bug on the following configurations:
FreeBSD 2.1.0, perl 5.001m
SunOS 4.1.4, perl 5.000
HP-UX 9, perl 5.000
IRIX 5.3, perl 5.000
perl5-porters, please try to reproduce this
- on an non-linux system (with 5.001m)
- on a linux system (with a non-debian 5.001m)
- on a debian linux system under ELF (my home-machine is not net.connected).
LEADERSHIP A form of self-preservation exhibited by people with auto-
destructive imaginations in order to ensure that when it comes to the crunch
it'll be someone else's bones which go crack and not their own.
- The Hipcrime Vocab by Chad C. Mulligan