From: sof Date: Wed, 31 Mar 1999 09:47:40 +0000 (+0000) Subject: [project @ 1999-03-31 09:47:40 by sof] X-Git-Tag: Approximately_9120_patches~6336 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=015d32ffbf5fcde91adc7e59b00a528e19bb5c2b;p=ghc-hetmet.git [project @ 1999-03-31 09:47:40 by sof] The bugfix that time forgot --- diff --git a/ghc/lib/std/Random.lhs b/ghc/lib/std/Random.lhs index a1a7e22..bdd2c52 100644 --- a/ghc/lib/std/Random.lhs +++ b/ghc/lib/std/Random.lhs @@ -164,7 +164,7 @@ mkStdRNG = do randomIvalInteger :: (RandomGen g, Num a) => (Integer, Integer) -> g -> (a, g) randomIvalInteger (l,h) rng | l > h = randomIvalInteger (h,l) rng - | otherwise = case (f n 1 rng) of (v, rng') -> (fromInteger (v `mod` (k+1)), rng') + | otherwise = case (f n 1 rng) of (v, rng') -> (fromInteger (l + v `mod` (k+1)), rng') where k = h - l + 1 b = 2147483561