View Source Randixir
Random generator for elixir based on Erlang/OTP, the recommended package for random
Installation
The package can be installed by adding randixir
to your list of dependencies in mix.exs
:
def deps do
[
{:randixir, "~> 0.1.0"}
]
end
The docs can be found at https://hexdocs.pm/randixir.
Usage
first, generate seed
:rand.seed(:exsplus, {13999, 2352, 15231})
Generate int
- supply only max (inclusive), defaulting min to 0
Randixir.int(5)
- supply min and max, both inclusive
Randixir.int(0,5)
Generate float
- supply only max (inclusive), defaulting min to 0
Randixir.float(5.0)
- supply min and max, both inclusive
Randixir.float(0.0,5.0)