Fix randoms:uniform/1 return

Make sure randoms:uniform/1 returns values from the same interval
as deprecated random:uniform/1
This commit is contained in:
Evgeniy Khramtsov 2016-10-18 08:35:47 +03:00
parent 4c5460f0bd
commit d19552f464
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ uniform() ->
crypto:rand_uniform(0, ?THRESHOLD)/?THRESHOLD.
uniform(N) ->
crypto:rand_uniform(0, N).
crypto:rand_uniform(1, N+1).
-ifdef(STRONG_RAND_BYTES).
bytes(N) ->