[GHC] #4867: ghci displays negative floats incorrectly (was: Incorrect result from trig functions)

GHC cvs-ghc at haskell.org
Sat Feb 12 18:54:52 CET 2011


#4867: ghci displays negative floats incorrectly (was: Incorrect result from trig
functions)
-------------------------------+--------------------------------------------
    Reporter:  gwright         |        Owner:  gwright                    
        Type:  bug             |       Status:  new                        
    Priority:  high            |    Milestone:  7.0.2                      
   Component:  GHCi            |      Version:  7.0.1                      
    Keywords:                  |     Testcase:                             
   Blockedby:                  |   Difficulty:                             
          Os:  MacOS X         |     Blocking:                             
Architecture:  x86_64 (amd64)  |      Failure:  Incorrect result at runtime
-------------------------------+--------------------------------------------

Comment(by batterseapower):

 I think a single minus sign is the expected result, and it is what I get
 with GHC and GHCi (near HEAD) on OS X 10.6. Note that:

     showSignedFloat showFloat 0 (-1.0) ""

 Calls showFloat with the last argument '''negated''' after outputting a
 minus sign, so showFloat itself will not get a chance to produce an extra
 minus sign. (The relevant line of showSignedFloat is Float.lhs:1016) The
 question seems to be why that negation is not happening on your machine.

 This seems unlikely, but is it possible that your GHCi is still somehow
 finding the version of the libraries that you edited before, and that
 version accidentally removed the negation?

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



More information about the Glasgow-haskell-bugs mailing list