Logo

Programming-Idioms

History of Idiom 15 > diff from v41 to v42

Edit summary for version 42 by programming-idioms.org:
[Elixir] Dead link: play.elixirbyexample.com has been down for a while

Version 41

2019-09-26, 20:34:09

Version 42

2019-10-14, 12:22:57

Idiom #15 Pick uniformly a random integer in [a..b]

Pick a random integer greater than or equals to a, inferior or equals to b. Precondition : a < b.

Idiom #15 Pick uniformly a random integer in [a..b]

Pick a random integer greater than or equals to a, inferior or equals to b. Precondition : a < b.

Extra Keywords
choose
Extra Keywords
choose
Code
:crypto.rand_uniform(a, b)
Code
:crypto.rand_uniform(a, b)
Doc URL
http://erlang.org/doc/man/crypto.html#rand_uniform-2
Doc URL
http://erlang.org/doc/man/crypto.html#rand_uniform-2
Demo URL
http://play.elixirbyexample.com/s/2030d98a44