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)
class ref Randomness
Constructors¶
create¶
new ref create(
seed1: U64 val = 42,
seed2: U64 val = 0)
: Randomness ref^
Parameters¶
Returns¶
- Randomness ref^
Public Functions¶
u8¶
generates a U8 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref u8(
min: U8 val = call,
max: U8 val = call)
: U8 val
Parameters¶
Returns¶
- U8 val
u16¶
generates a U16 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref u16(
min: U16 val = call,
max: U16 val = call)
: U16 val
Parameters¶
Returns¶
- U16 val
u32¶
generates a U32 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref u32(
min: U32 val = call,
max: U32 val = call)
: U32 val
Parameters¶
Returns¶
- U32 val
u64¶
generates a U64 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref u64(
min: U64 val = call,
max: U64 val = call)
: U64 val
Parameters¶
Returns¶
- U64 val
u128¶
generates a U128 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref u128(
min: U128 val = call,
max: U128 val = call)
: U128 val
Parameters¶
Returns¶
- U128 val
ulong¶
generates a ULong in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref ulong(
min: ULong val = call,
max: ULong val = call)
: ULong val
Parameters¶
Returns¶
- ULong val
usize¶
generates a USize in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref usize(
min: USize val = call,
max: USize val = call)
: USize val
Parameters¶
Returns¶
- USize val
i8¶
generates a I8 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref i8(
min: I8 val = call,
max: I8 val = call)
: I8 val
Parameters¶
Returns¶
- I8 val
i16¶
generates a I16 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref i16(
min: I16 val = call,
max: I16 val = call)
: I16 val
Parameters¶
Returns¶
- I16 val
i32¶
generates a I32 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref i32(
min: I32 val = call,
max: I32 val = call)
: I32 val
Parameters¶
Returns¶
- I32 val
i64¶
generates a I64 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref i64(
min: I64 val = call,
max: I64 val = call)
: I64 val
Parameters¶
Returns¶
- I64 val
i128¶
generates a I128 in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref i128(
min: I128 val = call,
max: I128 val = call)
: I128 val
Parameters¶
Returns¶
- I128 val
ilong¶
generates a ILong in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref ilong(
min: ILong val = call,
max: ILong val = call)
: ILong val
Parameters¶
Returns¶
- ILong val
isize¶
generates a ISize in closed interval [min, max] (default: [min_value, max_value])
behavior is undefined if min > max.
fun ref isize(
min: ISize val = call,
max: ISize val = call)
: ISize val
Parameters¶
Returns¶
- ISize val
f32¶
generates a F32 in closed interval [min, max] (default: [0.0, 1.0])
fun ref f32(
min: F32 val = 0.0,
max: F32 val = 1.0)
: F32 val
Parameters¶
Returns¶
- F32 val
f64¶
generates a F64 in closed interval [min, max] (default: [0.0, 1.0])
fun ref f64(
min: F64 val = 0.0,
max: F64 val = 1.0)
: F64 val
Parameters¶
Returns¶
- F64 val
bool¶
generates a random Bool value
fun ref bool()
: Bool val
Returns¶
- Bool val
shuffle[T: T]¶
fun ref shuffle[T: T](
array: Array[T] ref)
: None val
Parameters¶
- array: Array[T] ref
Returns¶
- None val