randcli
CLI as a Pseudo Random Number Generator
How?
# 'gauss' is same to 'gauss()' or 'gauss(0, 1)'
Functions
| Category | Name | Effect | Type | Default Args | Example |
|---|---|---|---|---|---|
| Seed | seed | Set Random Seed | unsigned int -> () -> () | seed(42) |
|
| Truncate | int | Truncate a float into int | () -> number -> int | int |
|
| .. | floor | same to int |
() -> number -> int | floor |
|
| .. | round | trancate into nearst int | () -> number -> int | round |
|
| Distribution | gauss | Gaussian Distribution (mean, variance) | (number, number) -> () -> number | (0, 1) | gauss() gauss(0, 1) |
| .. | uniform | Uniform Distribution of [min, max) | (number, number) -> () -> number | (0, 1) | uniform(1, 2) |
| .. | exp | Exponential Distribution (lambda) | number -> () -> number | 1 | exp(0.5) |
| .. | binom | Binomial Distribution (n, p) | (unsigned int, number) -> () -> number | binom(10, 0.5) |
|
| .. | bernoulli | Alias to binom(1, p) |
number -> () -> number | 0.5 | bernoulli(0.5) |
Type Notation forms X -> Y -> Z, which means
- It requires
Xdata as arguments- E.g.
42forseed(42)
- E.g.
- And then catches
Ydata from the previous pipe|- E.g.
intfunction reads a number data from the previous functions
- E.g.
- Lastly outputs
Zdata- E.g. Distribution functions will output a number data
Type () is None data.
Install