Random number generation
Overview
Multik provides the mk.rand() family of functions for creating arrays filled with random numbers. All values follow a uniform distribution. You can control the range, seed, and random generator.
Function | Description |
|---|---|
| Array with default random range for type |
| Array with values in |
| Reproducible random array with a seed. |
| Random array using a custom |
Default ranges by type
Type | Range |
|---|---|
|
|
|
|
|
|
|
|
Example
Pitfalls
Complex types (
ComplexFloat,ComplexDouble) are not supported. Used1array/d2arraywith a custom init lambda for complex random arrays.The
frombound is inclusive, theuntilbound is exclusive.