Floating point error
I'm running GHC version 6.12.1 on Debian Squeeze. While using the interpreter, I started getting unexpected results in some floating point operations. I have run some tests to pinpoint the problem, and I got the following results:
- 6+0.8=1.4 but 9.6+4.8=14.399999999999999
- 8+5.4=6.2 but 10.8+5.4=16.200000000000003
Is there any way to fix this?
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |