Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
015d32ff
Commit
015d32ff
authored
Mar 31, 1999
by
sof
Browse files
[project @ 1999-03-31 09:47:40 by sof]
The bugfix that time forgot
parent
db85bf1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/lib/std/Random.lhs
View file @
015d32ff
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment