The OpenD Programming Language

Mt19937_64

A MersenneTwisterEngine instantiated with the parameters of the original engine MT19937, generating uniformly-distributed 64-bit numbers with a period of 2 to the power of 19937.

This is recommended for random number generation on 64-bit systems unless memory is severely restricted, in which case a Xorshift would be the generator of choice.

import mir.random.engine.mersenne_twister;
alias Mt19937_64 = MersenneTwisterEngine!(ulong, 64, 312, 156, 31, 0xb5026f5aa96619e9, 29, 0x5555555555555555, 17, 0x71d67fffeda60000, 37, 0xfff7eee000000000, 43, 6364136223846793005)

Examples

import mir.random.engine;

auto gen = Mt19937_64(unpredictableSeed);
auto n = gen();

import std.traits;
static assert(is(ReturnType!gen == ulong));

Meta