[commit: packages/random] master: Cleanup + add comments (a3a70df)
git at git.haskell.org
git at git.haskell.org
Thu Mar 19 15:44:52 UTC 2015
Repository : ssh://git@git.haskell.org/random
On branch : master
Link : http://git.haskell.org/packages/random.git/commitdiff/a3a70df88018e8b7fd82c3feec91bf9087fb239e
>---------------------------------------------------------------
commit a3a70df88018e8b7fd82c3feec91bf9087fb239e
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date: Tue Jul 8 14:32:26 2014 +0200
Cleanup + add comments
Fixme reverred to formatting of comments, which was done in
24260b389852ab109de6b62822d889d0e66ae723
>---------------------------------------------------------------
a3a70df88018e8b7fd82c3feec91bf9087fb239e
System/Random.hs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/System/Random.hs b/System/Random.hs
index defb8e4..cebcccf 100644
--- a/System/Random.hs
+++ b/System/Random.hs
@@ -244,6 +244,11 @@ should be likely to produce distinct generators.
mkStdGen :: Int -> StdGen -- why not Integer ?
mkStdGen s = mkStdGen32 $ fromIntegral s
+{-
+From ["System.Random\#LEcuyer"]: "The integer variables s1 and s2 ... must be
+initialized to values in the range [1, 2147483562] and [1, 2147483398]
+respectively."
+-}
mkStdGen32 :: Int32 -> StdGen
mkStdGen32 sMaybeNegative = StdGen (s1+1) (s2+1)
where
@@ -256,8 +261,6 @@ mkStdGen32 sMaybeNegative = StdGen (s1+1) (s2+1)
createStdGen :: Integer -> StdGen
createStdGen s = mkStdGen32 $ fromIntegral s
--- FIXME: 1/2/3 below should be ** (vs at 30082002) XXX
-
{- |
With a source of random number supply in hand, the 'Random' class allows the
programmer to extract random values of a variety of types.
@@ -491,7 +494,7 @@ randomIvalDouble (l,h) fromDouble rng
(scaled_x, rng')
int32Count :: Integer
-int32Count = toInteger (maxBound::Int32) - toInteger (minBound::Int32) + 1
+int32Count = toInteger (maxBound::Int32) - toInteger (minBound::Int32) + 1 -- GHC ticket #3982
stdRange :: (Int,Int)
stdRange = (1, 2147483562)
More information about the ghc-commits
mailing list