URCW1 3CW "05 January 2007" "mathcw-1.00"

Table of contents


NAME

urcw1f, urcw1, urcw1l, urcw1w, urcw1q, urcw1ll, urcw1df, urcw1d, urcw1dl, urcw1dll - pseudorandom number in [0,1]

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float urcw1f (void);

extern double urcw1 (void);

extern long double urcw1l (void);

extern __float80 urcw1w (void);

extern __float128 urcw1q (void);

extern long_long_double urcw1ll (void);

extern decimal_float urcw1df (void);

extern decimal_double urcw1d (void);

extern decimal_long_double urcw1dl (void);

extern decimal_long_long_double urcw1dll (void);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Return a pseudorandom number uniformly distributed on [0,1] (that is, 0 <= urcw1() <= 1).

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.


RETURN VALUES

The pseudorandom number.

ERRORS

None.

SEE ALSO

ercw(3CW), ercw_r(3CW), gscw(3CW), incw_r(3CW), llrancw(3CW), llrancw_r(3CW), llrincw(3CW), llrincw_r(3CW), lrancw(3CW), lrancw_r(3CW), lrcw(3CW), lrcw_r(3CW), lrincw(3CW), lrincw_r(3CW), mscw(3CW), nrcw(3CW), nrcw_r(3CW), sccw(3CW), sscw(3CW), urcw(3CW), urcw1_r(3CW), urcw2(3CW), urcw2_r(3CW), urcw3(3CW), urcw3_r(3CW), urcw4(3CW), urcw4_r(3CW), urcw_r(3CW), vercw(3CW), vercw_r(3CW), vllrancw(3CW), vllrancw_r(3CW), vllrincw(3CW), vllrincw_r(3CW), vlrancw(3CW), vlrancw_r(3CW), vlrcw(3CW), vlrcw_r(3CW), vlrincw(3CW), vlrincw_r(3CW), vnrcw(3CW), vnrcw_r(3CW), vurcw(3CW), vurcw1(3CW), vurcw1_r(3CW), vurcw2(3CW), vurcw2_r(3CW), vurcw3(3CW), vurcw3_r(3CW), vurcw4(3CW), vurcw4_r(3CW), vurcw_r(3CW).