Commit dc83b06b authored by sof's avatar sof
Browse files

[project @ 1999-05-13 11:00:07 by sof]

randomIvalInteger: The difference between '1' and 'l' is rather slight
at the level of pixels. At the level of Haskell programs however, the
difference is rather more pronounced :)
parent f4a9632f
......@@ -172,7 +172,7 @@ mkStdRNG o = 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 (l + v `mod` (k+1)), rng')
| otherwise = case (f n 1 rng) of (v, rng') -> (fromInteger (l + v `mod` k), rng')
where
k = h - l + 1
b = 2147483561
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment