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

GHC trac at galois.com
Fri Jul 7 11:21:30 EDT 2006


#794: System.Random: StdGen's genRange doesn't match its next
-----------------------------------+----------------------------------------
  Reporter:  rturk at science.uva.nl  |          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


More information about the Glasgow-haskell-bugs mailing list