Giter VIP home page Giter VIP logo

lrand's Introduction

LRand : An updated version of lrandom for 5.3

About

"A library for generating random numbers based on the Mersenne Twister, a pseudorandom number generating algorithm developped by Makoto Matsumoto and Takuji Nishimura (alphabetical order) in 1996/1997."

API

table require"lrand"

The module table containing the API.

string lrand.version

The version string.

lrand_state lrand.new([seed])

Creates a new lrand_state, optionally seeded with a lua integer.

lrand_state lrand.clone(state)

Can also be called from the state state:clone().

Clones the state into a new lrand_state.

lrand_state lrand.seed(state[, seed])

Can also be called from the state state:seed([seed]).

Reseeds the state with an optional lua integer.

integer lrand.randu64(state)

Can also be called from the state state:randu64().

Consumes a random unsigned int64 from the state which is returned as a lua integer.

(raw range: [0, 2^64-1]) (range in lua: [math.mininteger, math.maxinteger])

integer lrand.randi64(state)

Can also be called from the state state:randi64().

Consumes a random int64 from the state which is returned as a lua integer.

(raw range: [0, 2^63-1]) (range in lua: [0, math.maxinteger] (may overflow in 'small lua'))

number lrand.randd(state)

Can also be called from the state state:randd().

Consumes a random real number from the state which is returned as a lua number.

(raw range: [0, 1]) (range in lua: [0,1])

lrand's People

Contributors

qintianchou avatar mehgugs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.