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

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
  • Comment on Re^4: test fails on 64bit uselongdouble Perl

Replies are listed 'Best First'.
Re^5: test fails on 64bit uselongdouble Perl
by moritz (Cardinal) on Oct 29, 2009 at 21:44 UTC
    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

        If the desired result is an integer, and the numeric errors are small, there's no need to correctly or robustly round 5.5, so I don't see how your earlier post applies here.
        Perl 6 - links to (nearly) everything that is Perl 6.
Re^5: test fails on 64bit uselongdouble Perl
by ikegami (Patriarch) on Oct 29, 2009 at 21:19 UTC

    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.

        I have already tried explicit rounding rather than using sprintf but I will also try variations of that.

        sprintf, as you used it, didn't round.