Commits

Aleksey Khudyakov  committed 9a3845f

Fix bug in distributions

  • Participants
  • Parent commits f5729b9

Comments (0)

Files changed (1)

File 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 #-}