Ticket #1272 (closed merge: fixed)
newStdGen returns the same value on successive calls
| Reported by: | guest | Owned by: | igloo |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.8.1 |
| Component: | libraries/base | Version: | 6.6 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description (last modified by igloo) (diff)
It seems newStdGen only depends on the second, it should have better resolution and/or use /dev/random.
Test program:
import Random main = newStdGen >>= print
compiled with ghc 6.6 or 6.7 (at some point in time) Running "date; ./random" gives:
Thu Apr 12 10:51:54 CEST 2007 1938403181 6764 Thu Apr 12 10:51:54 CEST 2007 1938403181 6764 Thu Apr 12 10:51:55 CEST 2007 529729936 6762 Thu Apr 12 10:51:55 CEST 2007 529729936 6762 Thu Apr 12 10:51:56 CEST 2007 1023702766 6762 Thu Apr 12 10:51:56 CEST 2007 1023702766 6762 Thu Apr 12 10:52:03 CEST 2007 186545450 6762 Thu Apr 12 10:52:04 CEST 2007 680518280 6762 Thu Apr 12 10:52:04 CEST 2007 680518280 6762
Change History
Note: See
TracTickets for help on using
tickets.
