logo       

Re: [GHC] #794: System.Random: StdGen's genRange doesn't match its next: msg#00031

lang.haskell.glasgow.bugs

Subject: Re: [GHC] #794: System.Random: StdGen's genRange doesn't match its next

#794: System.Random: StdGen's genRange doesn't match its next
-----------------------------------+----------------------------------------
Reporter: rturk@xxxxxxxxxxxxxx | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: libraries/base | Version: 6.4.2
Severity: normal | Resolution: fixed
Keywords: | Os: Unknown
Difficulty: Easy (1 hr) | Architecture: Unknown
-----------------------------------+----------------------------------------
Changes (by simonpj):

* resolution: => fixed
* status: new => closed

Comment:

Good point. Rather than try to make {{{Random.stdNext}}} return numbers
in the full range (which is dodgy, because stdNext is carefully crafted
code), I changed the {{{genRange}}} method of {{{Random StdGen}}} to
return the range that {{{stdNext}}} actually delivers.

The documentation only guarantees a 30-bit range, which is still the case.

Simon

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/794>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise