We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 044cf4d commit 025dcb7Copy full SHA for 025dcb7
lib/Echidna/ABI.hs
@@ -186,12 +186,12 @@ getRandomUint n =
186
187
-- | Generate a random signed integer with the following distribution:
188
-- * 10% uniformly from the range -1023 to 1023.
189
--- * 90% uniformly from the range -1 * 2 ^ n to 2 ^ (n - 1).
+-- * 90% uniformly from the range -1 * 2 ^ (n - 1) to 2 ^ (n - 1) - 1.
190
getRandomInt :: MonadRandom m => Int -> m Integer
191
getRandomInt n =
192
getRandomR =<< Random.weighted
193
[ ((-1023, 1023), 1)
194
- , ((-1 * 2 ^ n, 2 ^ (n - 1)), 9)
+ , ((-1 * 2 ^ (n - 1), 2 ^ (n - 1) - 1), 9)
195
]
196
197
-- | Synthesize a random 'AbiValue' given its 'AbiType'. Doesn't use a dictionary.
0 commit comments