[Haskell-cafe] Re: A question about "monad laws"

Felipe Lessa felipe.lessa at gmail.com
Mon Feb 11 10:50:59 EST 2008


On Feb 11, 2008 1:35 PM, Andrew Butterfield
<Andrew.Butterfield at cs.tcd.ie> wrote:
> Hugs> 1.0 + (2.5e-15 + 2.5e-15)
> 1.00000000000001 :: Double
> Hugs> (1.0 + 2.5e-15) + 2.5e-15
> 1.0 :: Double

Prelude> (1e30 + (-1e30)) + 1
1.0
Prelude> 1e30 + ((-1e30) + 1)
0.0

I love this example from David Goldberg
(http://docs.sun.com/source/806-3568/ncg_goldberg.html).

-- 
Felipe.


More information about the Haskell-Cafe mailing list