Floating point numbers

From HaskellWiki
Revision as of 23:35, 31 January 2009 by Lemming (talk | contribs) (Category:Mathematics)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Question

Why do floating point numbers behave so strange? Why is

Prelude> compare (0/0) (0/0)
GT
Prelude> (0/0) > (0/0)
False

?

Answer

This has nothing to do with Haskell, but exclusively with the underlying implementation of floating point numbers in your system.

See for instance: