[Haskell-cafe] Why 'round' does not just round numbers ?

Thomas Davie tom.davie at gmail.com
Mon Oct 27 09:50:56 EDT 2008


>> [1] The Haskell 98 Report: Predefined Types and Classes
>>   http://haskell.org/onlinereport/basic.html
>
> This behaviour is not what I expect after reading the description at
> http://haskell.org/ghc/docs/latest/html/libraries/base/ 
> Prelude.html#v:round
> .  Given that this behaviour has caused a bit of confusion I think a
> change to the documention might be in order.

Given that the documentation says "round x returns the nearest integer  
to x", I think pretty much any behavior can be expected -- there's no  
single integer nearest to 2.5.  The documentation certainly needs  
updated though.

Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081027/03322226/attachment.htm


More information about the Haskell-Cafe mailing list