On Eq, was Re: [Haskell-cafe] When to use fancy types [Re: NumberTheory library]

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sat May 14 12:31:08 EDT 2005


"Jacques Carette" <carette at mcmaster.ca> writes:

> Since +0 and -0 both exist as separate 'entities' (as computer bits),
> which are their own normal form, the real question to ask is, why
> would they be equal?

Because (1.0 - 1.0) == -(1.0 - 1.0) should be true. In general
arithmetic on integers which are representable in floating point
is exact, including checking for equality.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Haskell-Cafe mailing list