Git Product home page Git Product logo

mersenne's Introduction

This is a simple MT19937 random number generator. The code is straightforward conversion of the Mersenne Twister pseudocode published on the Wikipedia page into C (1989 standard).

The generator is initialized by the ms_init function. After this, 32-bit pseudorandom numbers can be generated by calling ms_rand(). If the user doesn't call ms_init prior to the first call to ms_rand(), the generator is seeded to the system time (unless lines 6 and 7 are commented out, in which case, you'd better seed the generator with something or you'll get all zeroes). The main function included in this code is a very simple demo that counts instances of generated pseudorandom numbers between 0 and 19 and prints the counts.

mersenne's People

Contributors

adnelson avatar

Watchers

James Cloos avatar  avatar  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.