in reply to Calculation discrepancy between Perl versions

I suspect the differences result from differences in how floating point is handled on the different systems affecting the cumulated error from the sequence of calculations.

You could try re-implementing using Math::BigFloat and setting a sufficiently large (or is that small?) precision so that the cumulated error is sufficiently small.

If my guess is correct, you might find What Every Computer Scientist Should Know About Floating-Point Arithmetic helpful.

  • Comment on Re: Calculation discrepancy between Perl versions