in reply to Re^2: test fails on 64bit uselongdouble Perl
in thread test fails on 64bit uselongdouble Perl

You can't use floats if differences are a problem. Like I said, with floats, you have to be satisfied with no differences within a tolerance.

  • Comment on Re^3: test fails on 64bit uselongdouble Perl

Replies are listed 'Best First'.
Re^4: test fails on 64bit uselongdouble Perl
by frankcox (Acolyte) on Oct 29, 2009 at 21:13 UTC

    The output of my algorithm is an integer. On all other Perls tested by CPAN Testers I get the same integer. On uselongdouble Perls I usually get the same int too, but for some values I get an integer that is one off, sometimes high and sometime low. It's really just a a lucky fluke that a test happened to use a value that uncovered the bug

    I may have to remove support for these "problem" Perls by aborting the build. I'd rather not do that but it's better than giving wrong results

    If you're interested, there are more details in this RT ticket:

    http://rt.cpan.org/Ticket/Display.html?id=50820
      The output of my algorithm is an integer

      That makes things much easier. You can always just round to the nearest integer at the end, and as long as the numeric error is less than 0.5 you still get the same result.

      Perl 6 - links to (nearly) everything that is Perl 6.

        You can always just round to the nearest integer at the end

        Not quite. See my earlier post

      The output of my algorithm is an integer.

      So?

      I'd rather not do that but it's better than giving wrong results

      There's another alternative: Fixing your bug.

        There's another alternative: Fixing your bug.

        This is exactly what I want to do. It's not clear to me yet how to do that but I have some new ideas from this discussion. For example I will play with the idea of controlling the size of the the floats as mentioned by ikegami above. I have already tried explicit rounding rather than using sprintf but I will also try variations of that.

        I should have said above that I may have to remove support for uselongdouble Perls until I can fix this bug. This bug has already been open three days.