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

0.0.2 • Public • Published

Random implement of neko.Random

npm tests GitHub

This is one of the most used PRNG algorithms by Motion-Twin. The algorithm is based upon Mersenne Twister, TT800 a 623-dimensionally equidistributed uniform PRNG co-authored by 松本眞 (Makoto Matsumoto) and 西村拓士 (Takuji Nishimura) in 1994, 1996 ; reimplemented and optimized for JavaScript by Angelisium in 2023.

It's 100% compatible with the original C implementation and the customized neko implementation.

Note
If you are looking for how to use it, you can look at some examples in the unit tests.

Constructor

new MT_TT800(?seed: Int = 0)

Methods

// returns a neko random [0-max] integer
public nekoInteger(max: Int): Int
// return a neko random [0-1] float
public nekoFloat(): Float
// return a MT TT800 [0x0-0xffffffff] integer
public integer(): Int
// return a MT TT800 [0-1] float
public float(): Float

Readme

Keywords

Package Sidebar

Install

npm i neko-random

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

5.55 kB

Total Files

5

Last publish

Collaborators

  • angelisium