[GHC] #13384: Windows build thinks sqrt (-1) == -1

GHC ghc-devs at haskell.org
Mon Mar 6 22:02:02 UTC 2017


#13384: Windows build thinks sqrt (-1) == -1
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.0.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 bgamari):

 Ummmm....
 {{{
 ben at schildmann MINGW64 ~/ghc$ hi.c
 #include <math.h>
 #include <stdio.h>

 void main() { printf("%f\n", sqrt(-1)); }

 ben at schildmann MINGW64 ~/ghc$ gcc hi.c -O0

 ben at schildmann MINGW64 ~/ghc$ ./a.exe
 -1.000000
 }}}

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


More information about the ghc-tickets mailing list