[GHC] #14377: some results not expected with the addition

GHC ghc-devs at haskell.org
Sun Oct 22 20:05:26 UTC 2017


#14377: some results not expected with the addition
-------------------------------------+-------------------------------------
        Reporter:  vanto             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             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:                    |
-------------------------------------+-------------------------------------

Comment (by vanto):

 It has nothing to do with what you say otherwise why other languages give
 correct results and not GHC? Maybe there is something in common between
 OCaml and GHC. And that
 produces this error. We need to find.\\
 This problem, you says,  began to manifest itself from the 1950s, and we
 still talk about it. In the past we managed to get results as we wanted.\\
 So two things:
 - the way followed by GHC (in computation) is not the right one.\\
 or\\

 - there is a breakdown somewhere.
 and as you can see, the other systems stand out from GHC. if it is the
 fault of the base on which GHC is built then it is necessary to change the
 base.\\
 look again at this result, do you think it is reasonable?
 while the other languages write a good result that is consistent with our
 expectations? These results are repetitive, so why always the same poorly
 written results?\\

 {{{
 Prelude> 16.0/0.2
 80.0
 Prelude> 16.0/0.02
 800.0
 Prelude> 16.0/0.002
 8000.0
 Prelude> 16.0/0.0002
 80000.0
 Prelude> 16.0/0.00002
 799999.9999999999
 Prelude> 16.0/0.000002
 8000000.0
 Prelude> 16.0/0.0000002
 8.0e7
 Prelude> 16.0/0.00000002
 8.0e8
 Prelude> 16.0/0.000000002
 7.999999999999999e9
 Prelude> 16.0/0.0000000002
 8.0e10
 Prelude> 16.0/0.00000000002
 8.0e11
 Prelude> 16.0/0.000000000002
 8.0e12
 Prelude> 16.0/0.0000000000002
 8.0e13
 Prelude> 16.0/0.00000000000002
 8.0e14
 Prelude> 16.0/0.000000000000002
 7.999999999999999e15
 Prelude> 16.0/0.0000000000000002
 8.0e16
 Prelude> 16.0/0.00000000000000002
 8.0e17
 Prelude> 16.0/0.000000000000000002
 7.999999999999999e18
 Prelude> 16.0/0.0000000000000000002
 8.0e19
 }}}

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


More information about the ghc-tickets mailing list