Skip to main content

next

Macro next 

Source
macro_rules! next {
    (xor32u) => { ... };
    (xor32f) => { ... };
    (mt32u) => { ... };
    (mt32f) => { ... };
    (pcg32u) => { ... };
    (pcg32f) => { ... };
    (philox32u) => { ... };
    (philox32f) => { ... };
    (tgfsr32u) => { ... };
    (tgfsr32f) => { ... };
    (xor64u) => { ... };
    (xor64f) => { ... };
    (mt64u) => { ... };
    (mt64f) => { ... };
    (philox64u) => { ... };
    (philox64f) => { ... };
    (xor128u) => { ... };
    (xor128f) => { ... };
}
Expand description

Generates the next random value using the specified algorithm and output type.

Seeds are automatically generated from the system time.

The argument format is [algorithm][bits][type].

  • type: u for unsigned integer, f for floating-point [0, 1).

ยงExamples

use urng::next;

let val_u32 = next!(mt32u);
let val_f32 = next!(xor32f);