logo       

[ ghc-Bugs-815511 ] Floating pt. arithmetic bugs / inexplicable inaccuracy: msg#00001

lang.haskell.glasgow.bugs

Subject: [ ghc-Bugs-815511 ] Floating pt. arithmetic bugs / inexplicable inaccuracy

Bugs item #815511, was opened at 2003-09-30 23:48
Message generated for change (Comment added) made by simonmar
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=815511&group_id=8032

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Joe Lee (yjo)
Assigned to: Nobody/Anonymous (nobody)
Summary: Floating pt. arithmetic bugs / inexplicable inaccuracy

Initial Comment:
in ghci 6.0.1, eg:

Prelude> 1.1 + 2.2
3.3000000000000003

----------------------------------------------------------------------

>Comment By: Simon Marlow (simonmar)
Date: 2003-10-01 08:55

Message:
Logged In: YES
user_id=48280

True, 1.1 2.2 and 3.3 are all representable as doubles, it
seems, so why does 1.1 + 2.2 not give the exact answer?

I get the same result from a C program, so I don't think
this is specific to GHC.

Any experts on floating point arithmetic want to comment on
why this happens?


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=815511&group_id=8032


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise