Skip to content

jslba/neko-random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An implementation of neko.Random

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published