Skip to content

A replacement for rand()/srand() that's ~700% faster and typically has better statistical distribution. An adaptationof Melissa O'Neill's PCG rand with a fallback to xor-rand for 32-bit code.

mattreecebentley/plf_rand

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

plf::rand

A C++ 03/11/etc replacement for rand()/srand() that's ~700% faster and typically has better statistical distribution. An adaptation of Melissa O'Neill's PCG rand (https://www.pcg-random.org/) with a fallback to xorshift generation for C++98/03 (which don't support the uint_64_t types which PCG generators require). See her page for more information and stats on the algorithm.

The two functions, plf::rand() and plf::srand(), correspond to rand()/srand() in terms of their parameters and return values.

About

A replacement for rand()/srand() that's ~700% faster and typically has better statistical distribution. An adaptationof Melissa O'Neill's PCG rand with a fallback to xor-rand for 32-bit code.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages