#5133: Random instance for Float can generate values out of requested range
---------------------------------+------------------------------------------
    Reporter:  richardsenington  |       Owner:                
        Type:  bug               |      Status:  new           
    Priority:  normal            |   Component:  libraries/base
     Version:  7.1               |    Keywords:  System.Random 
    Testcase:                    |   Blockedby:                
          Os:  Linux             |    Blocking:                
Architecture:  x86               |     Failure:  None/Unknown  
---------------------------------+------------------------------------------
 Recently I was using the standard random number generator and found it
 that the program was breaking with an array index out of range.

 I was using the Float data type not Double. The range was the basic (0,1)
 range. The test code is the following.

 test :: Float
 test = let gen = read "1005320695 588518561" :: StdGen
        in fst $ random gen

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5133>
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