[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1732: Bad arithmetic in new perl packages

On Sun, 22 Oct 1995, J.H.M.Dassen wrote:

> Fernando wrote to debian-bugs:
(problem with 5.001m, but not 5.001e)

> > 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.

Without seeing a short example script, it's dangerous to guess, but I'll do
so anyway.

There is a very subtle bug that can arise in some rare situations where
perl has to convert back and forth between string and floating point
representations, but that's almost certainly not the problem here.

I also can't think of anything in 5.001m (as opposed to 5.001e) that
might have affected this.

I'd guess one of two things is going on:

1.  This is the usual sort of problem that arises when folks forget
that floating point arithmetic isn't exact.  Perl5 is pretty forgiving,
and tries hard to print what you want, but doesn't always succeed.

2.  The tests are running on a buggy pentium :-).
> Fernando, I unfortunately have no idea what is causing this. Please
> provide a short script which shows this behaviour (reliably if possible).

    Andy Dougherty		doughera@lafcol.lafayette.edu
    Dept. of Physics
    Lafayette College, Easton PA 18042

Reply to: