Commits

Aleksey Khudyakov committed 9a3845f

Fix bug in distributions

Comments (0)

Files changed (1)

System/Random/MWC.hs

     buckets = maxBound `div` n
     maxN    = buckets * n
     go = do x <- rnd
-            if x < maxN then return (x `div` maxN)
+            if x < maxN then return (x `div` buckets)
                         else go
 {-# INLINE unsignedRange #-}