gjrand random numbers

Gjrand is free software (GPL v2 or v3) hosted at SourceForge.

The SourceForge project page:
SourceForge.net Logo


Why i think gjrand is good.

Pseudo-random number generator.
Random number test suite.

The gjrand project is about pseudo-random number generation for the purpose of simulations, Monte-Carlo integration, computer games and the like. It is intended that statistical properties be extremely good for such purposes. However, gjrand is not suitable as a high security random number generator for cryptography, the state lottery draw, etc.

Currently, gjrand provides a C programmer's library with generators for:

and also statistical testing programs that can be used to test the gjrand library, or other supposedly random data:

Current status

As of April 2010 the latest version released is which is described as "alpha-test". It can't go "beta-test" until i receive reports from alpha testers, which has never happened yet.

Also of interest is version which has almost identical API but uses a very different generator internally. This can be useful for running a simulation twice with different generators to gain confidence that bad random numbers are not causing artifacts.

There were known bugs in almost all versions up to, fixed in and later. A more minor bug was in only.

Earlier versions were developed and tested on a 32bit X86 GNU/Linux platform, and recent ones on 64bit X86 GNU/Linux. As far as i know the current version hasn't been tested on anything else.

Version and a few earlier ones were tested on most of the SourceForge compiler farm machines. These were all approximately Posix (Linux, BSD, MAC OS X, Solaris) with Gcc. The compile farm shut down in February 2007 so such portability testing is no longer possible. If you have portability problems or fixes please post on gjrand SourceForge forums.

If attempting to port it will be easiest with an ANSI C compiler with support for at least a few C99 features, stdint.h especially. Gcc has had this for years. Also it will be easiest on POSIX or near approximation. If using MS-Windows, Cygwin with GCC is recommended (though i haven't tried even this). Other options may need significant porting effort.

In case you're looking for it, Geronimo Jones' nda test is part of the gjrand package. Download as above, unpack the tar file, it's in subdirectory testunif/src .