cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ] #include <mathcw.h> extern float urcw4f (void); extern double urcw4 (void); extern long double urcw4l (void); extern __float80 urcw4w (void); extern __float128 urcw4q (void); extern long_long_double urcw4ll (void); extern decimal_float urcw4df (void); extern decimal_double urcw4d (void); extern decimal_long_double urcw4dl (void); extern decimal_long_long_double urcw4dll (void);
NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.
This function is equivalent to urcw(3CW).
The generator state is kept internally to simplify the user interface. However, this is not safe in multithreaded programs. For them, use the reentrant generator routines instead, identified by the suffix _r. The reentrant routines also make possible families of independent generators within the same program.
The generator is Marsaglia's KISS generator, which has a long period of about 2**123 (approximately 10**37), and has passed several difficult tests of randomness, including Marsaglia's Diehard Battery test suite, and the Marsaglia/Tsang tuftest suite.
The double functions sample the 32-bit integer generator twice, the long double functions sample it four times, and the long long double functions sample it eight times,
When precision permits, the decimal floating-point functions use the corresponding binary generator, and then convert that result to decimal. Otherwise, they convert several samples of the integer generator to decimal floating-point with suitable scaling.