Re: round doesn't seem to work correctly

Malcolm Wallace <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.bugs
Organization Dept of Computer Science, University of York, UK.
Message-ID <[email protected]>
Martin Erwig <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.