round doesn't seem to work correctly
30 Jul
2002
30 Jul
'02
5:12 p.m.
Hi, I am using Hugs (Version: December 2001) on Unix (Solaris). I think that round might not be working correctly for numbers that end with "2.5". For example, Prelude> round 2.5 2 Prelude> round 72.500 72 Prelude> round 11112.5 11112 Thanks, Martin
30 Jul
30 Jul
5:20 p.m.
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
8793
Age (days ago)
8793
Last active (days ago)
1 comments
2 participants
participants (2)
-
Malcolm Wallace -
Martin Erwig