Noncollinear Perpendicular Microcrystalline

    mtwist
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    MTwist

    • A concise Mersenne Twister implementation in CoffeeScript/JavaScript
    • Includes the 2002 initialization improvements
    • Tested against the original C implementation

    Why would I use this?

    • You want to be able to seed your random number generator to create reproducible sequences
    • You want to know exactly how your random numbers are generated across all JS engines

    How do I use this?

    x = Math.random();
    

    becomes

    seed = 1234567890;  // an integer between 0 and 4294967295
    m = new MTwist(seed);
    x = m.random();
    

    Methods to produce evenly distributed integers in the ranges [0,n) and [m,n] are also provided.

    For details, see mtwist.coffee.

    Licence

    Copyright 2014 George MacKerron and released under the MIT Licence.

    Install

    npm i mtwist

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    6.79 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar