#5764: Double addition error
-------------------------+--------------------------------------------------
    Reporter:  jimstutt  |        Owner:                             
        Type:  bug       |       Status:  closed                     
    Priority:  normal    |    Component:  Compiler                   
     Version:  7.2.2     |   Resolution:  invalid                    
    Keywords:            |           Os:  Unknown/Multiple           
Architecture:  x86       |      Failure:  Incorrect result at runtime
    Testcase:            |    Blockedby:                             
    Blocking:            |      Related:                             
-------------------------+--------------------------------------------------
Changes (by ross):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 It's an artifact of fixed-precision floating point not being able to
 represent decimal fractions exactly; you get the same from C:
 {{{
 #include <stdio.h>

 int main() {
         printf("%.17f\n", 0.1+0.2);
         return 0;
 }
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5764#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to