Random instance for Float can generate values out of requested range
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
Trac metadata
Trac field | Value |
---|---|
Version | 7.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries/base |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |