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

GHC ghc-devs at haskell.org
Sun Oct 22 11:47:35 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):

 I discovered that OCaml computes with the same errors. maybe a shared
 file?\\

 {{{
 $ ocaml
         OCaml version 4.04.0

 # 1.1+.2.2;;
 - : float = 3.3000000000000003
 # 1.11+.2.22;;
 - : float = 3.33
 # 1.111+.2.222;;
 - : float = 3.333
 # 1.1111+.2.2222;;
 - : float = 3.3333
 # 1.11111+.2.22222;;
 - : float = 3.33333
 # 1.111111+.2.222222;;
 - : float = 3.3333329999999997
 # 1.1111111+.2.2222222;;
 - : float = 3.3333333
 # 1.11111111+.2.22222222;;
 - : float = 3.33333333
 # 1.111111111+.2.222222222;;
 - : float = 3.333333333
 # 1.1111111111+.2.2222222222;;
 - : float = 3.3333333333
 # 1.11111111111+.2.22222222222;;
 - : float = 3.33333333333
 # 1.111111111111+.2.222222222222;;
 - : float = 3.333333333333
 # 1.1111111111111+.2.2222222222222;;
 - : float = 3.3333333333333
 # 1.11111111111111+.2.22222222222222;;
 - : float = 3.3333333333333304
 # 1.111111111111111+.2.222222222222222;;
 - : float = 3.333333333333333
 #
 }}}
 while the other interpreters all give an expected result.\\

 {{{
 T h e   M i r a n d a   S y s t e m

       version 2.041 last revised 15 August 2008

       Copyright Research Software Ltd 1985-2008

         World Wide Web: http://miranda.org.uk


 new file script.m
 for help type /h
 Miranda 1.1+2.2
 3.3
 Miranda 1.111111+2.222222
 3.333333
 Miranda 1.11111111111111+2.22222222222222
 3.333333333333
 Miranda
 }}}
 \\

 {{{
 Standard ML of New Jersey v110.81 [built: Thu May 04 14:21:06 2017]
 - 1.1+2.2;
 val it = 3.3 : real
 - 1.111111+2.222222;
 val it = 3.333333 : real
 - 1.11111111111111+2.22222222222222;
 val it = 3.33333333333 : real
 -
 }}}
 \\

 {{{
 >       Caml Light version 0.74

 #1.1+.2.2;;
 - : float = 3.3
 #1.111111+.2.222222;;
 - : float = 3.333333
 #1.11111111111111+.2.22222222222222;;
 - : float = 3.33333333333
 #
 }}}
 You can read the difference between Caml Light and OCaml.

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


More information about the ghc-tickets mailing list