#4381: scaleFloat does not handle overflow correctly.
---------------------------------+------------------------------------------
    Reporter:  draconx           |       Owner:                             
        Type:  bug               |      Status:  new                        
    Priority:  normal            |   Component:  libraries/base             
     Version:  6.12.3            |    Keywords:                             
    Testcase:                    |   Blockedby:                             
          Os:  Unknown/Multiple  |    Blocking:                             
Architecture:  Unknown/Multiple  |     Failure:  Incorrect result at runtime
---------------------------------+------------------------------------------
 If you call scaleFloat with a somewhat large integer value, the result
 correctly overflows and yields Infinity.  However, if you call scaleFloat
 with an extremely large integer value, the result is finite!

 {{{
 > scaleFloat 30000 1
 Infinity

 > scaleFloat (maxBound :: Int) 1
 0.5
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4381>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to