Skip to content
Snippets Groups Projects
Commit 015d32ff authored by sof's avatar sof
Browse files

[project @ 1999-03-31 09:47:40 by sof]

The bugfix that time forgot
parent db85bf1c
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment