#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 altaic):

 Not sure if you had already discovered this, but it appears the bug is
 limited to `Double`, while `Float` appears to be fine:
 {{{
 Prelude> -1.0 :: Float
 -1.0
 Prelude> -1.0 :: Double
 -3.666940035476786e76
 }}}

 Oddly, the transform that's producing the garbage value is reversible
 (guessing there'd be loss of bits at extremes):
 {{{
 Prelude> -1.0 :: Double
 -3.666940035476786e76
 Prelude> -3.666940035476786e76 :: Double
 -1.0
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to