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.

Notifications You must be signed in to change notification settings

mattreecebentley/plf_rand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

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