We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a21d767 commit 5342defCopy full SHA for 5342def
1 file changed
src/Test/QuickCheck/LCG.purs
@@ -26,9 +26,12 @@ lcgM = 48271
26
lcgC :: Int
27
lcgC = 0
28
29
--- | The *modulus*: a magic constant for the linear congruential generator
+-- | The *modulus*: a magic constant for the linear congruential generator.
30
+-- | It is equal to 2^31 - 1, a Mersenne prime. It is useful for this value to
31
+-- | be prime, because then the requirement of the initial seed being coprime
32
+-- | to the modulus is satisfied when the seed is between 1 and lcgN - 1.
33
lcgN :: Int
-lcgN = 1 `shl` 31 - 1
34
+lcgN = 2147483647
35
36
-- | Step the linear congruential generator
37
lcgNext :: Int -> Int
0 commit comments