Randomness¶
Source of randomness, providing methods for generatic uniformly distributed values from a given closed interval: [min, max] in order for the user to be able to generate every possible value for a given primitive numeric type.
All primitive number method create numbers in range [min, max)
Constructors¶
create¶
Parameters¶
Returns¶
- Randomness ref^
Public Functions¶
u8¶
Generate a U8 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- U8 val
u16¶
Generate a U16 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- U16 val
u32¶
Generate a U32 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- U32 val
u64¶
Generate a U64 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- U64 val
u128¶
Generate a U128 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- U128 val
ulong¶
Generate a ULong in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- ULong val
usize¶
Generate a USize in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- USize val
i8¶
Generate a I8 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- I8 val
i16¶
Generate a I16 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- I16 val
i32¶
Generate a I32 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- I32 val
i64¶
Generate a I64 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- I64 val
i128¶
Generate a I128 in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- I128 val
ilong¶
Generate a ILong in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- ILong val
isize¶
Generate a ISize in closed interval [min, max] (default: [min_value, max_value]).
Behavior is undefined if min
> max
.
Parameters¶
Returns¶
- ISize val
f32¶
Generate a F32 in closed interval [min, max] (default: [0.0, 1.0]).
Parameters¶
Returns¶
- F32 val
f64¶
Generate a F64 in closed interval [min, max] (default: [0.0, 1.0]).
Parameters¶
Returns¶
- F64 val
bool¶
Generate a random Bool value.
Returns¶
- Bool val
shuffle[T: T]¶
Parameters¶
- array: Array[T] ref
Returns¶
- None val