[GHC] #14377: false result in the addition

GHC ghc-devs at haskell.org
Sat Oct 21 16:12:19 UTC 2017


#14377: false result in the addition
-------------------------------------+-------------------------------------
        Reporter:  vanto             |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:  invalid           |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by nickkuk):

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


Comment:

 Please, use Rational instead of float arithmetics:

 {{{
 Prelude> fromRational (1.1 + 2.2)
 3.3
 Prelude> fromRational (1.111111+2.222222)
 3.333333
 Prelude> fromRational (1.11111111111111+2.22222222222222)
 3.33333333333333
 }}}

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


More information about the ghc-tickets mailing list