A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/libmir/mir-random below:

libmir/mir-random: Advanced Random Number Generators

Advanced Random Number Generators

Documentation - http://mir-random.libmir.org/

This library is for general-purpose random number generation. Do not use it for cryptography or secret generation.

void main()
{
    import mir.random;
    import mir.random.variable: normalVar;
    import mir.random.algorithm: randomSlice;

    auto sample = normalVar.randomSlice(10);

    import std.stdio;
    sample[$.randIndex].writeln;
}
void main()
{
    import mir.random;
    import mir.random.variable: normalVar;
    import mir.random.algorithm: randomSlice;

    // Engines are allocated on stack or global
    auto rng = Random(unpredictableSeed);
    auto sample = rng.randomSlice(normalVar, 10);

    import std.stdio;
    sample[rng.randIndex($)].writeln;
}
random (new implementation and API) random.engine.* (fixed, reworked, new)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4