round doesn't seem to work correctly

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Tue, 30 Jul 2002 18:20:25 +0100


Martin Erwig <erwig@cs.orst.edu> writes:

> I think that round might not be working correctly for numbers
> that end with "2.5".
> 
> Prelude> round 2.5
> 2

This is correct according to the Haskell'98 report, and all the other
Haskell implementations agree with Hugs.  Section 6.4.6:

    "round x returns the nearest integer to x, the even integer if
     x is equidistant between two integers."


Regards,
    Malcolm