[GHC] #5133: Random instance for Float can generate values out of requested range

GHC cvs-ghc at haskell.org
Thu May 12 23:28:09 CEST 2011


#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  
---------------------------------+------------------------------------------

Comment(by daniel.is.fischer):

 Strictly speaking, the documentation says "normally":
 {{{
 -- * For fractional types, the range is normally the semi-closed interval
 -- @[0,1)@.
 }}}
 So it's not against the letters of the spec. But it would of course be
 better if it didn't produce 1. However, avoiding that would cost
 performance. I'm going to benchmark how much.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5133#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list