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

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Mon Oct 27 10:14:56 EDT 2008


On 2008 Oct 27, at 6:00, Henning Thielemann wrote:
> On Mon, 27 Oct 2008, L.Guo wrote:
>> I think this is unresonable. then try it in GHC 6.8.3.
>>
>> Prelude> round 3.5
>> 4
>> Prelude> round 2.5
>> 2
>>
>> Is there any explanation about that ?
>
> It's the definition we learnt in school ...

Maybe you did; I learned "5/9 rounding".

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list