GNU.WIKI: The GNU/Linux Knowledge Base

[HOME] [PHP Manual] [HowTo] [ABS] [MAN1] [MAN2] [MAN3] [MAN4] [MAN5] [MAN6] [MAN7] [MAN8] [MAN9]

[0-9] [Aa] [Bb] [Cc] [Dd] [Ee] [Ff] [Gg] [Hh] [Ii] [Jj] [Kk] [Ll] [Mm] [Nn] [Oo] [Pp] [Qq] [Rr] [Ss] [Tt] [Uu] [Vv] [Ww] [Xx] [Yy] [Zz]

## NAMEdrand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48, lcong48 - generate uniformly distributed pseudo-random numbers ## SYNOPSIS#include <stdlib.h> double drand48(void); double erand48(unsigned short ## DESCRIPTIONThese functions generate pseudo-random numbers using the linear congruential algorithm and 48-bit integer arithmetic. The drand48() and erand48() functions return nonnegative double- precision floating-point values uniformly distributed between [0.0, 1.0). The lrand48() and nrand48() functions return nonnegative long integers uniformly distributed between 0 and 2^31. The mrand48() and jrand48() functions return signed long integers uniformly distributed between -2^31 and 2^31. The srand48(), seed48() and lcong48() functions are initialization functions, one of which should be called before using drand48(), lrand48() or mrand48(). The functions erand48(), nrand48() and jrand48() do not require an initialization function to be called first. All the functions work by generating a sequence of 48-bit integers, ## ATTRIBUTESMultithreading (see pthreads(7)) The drand48(), erand48(), lrand48(), nrand48(), mrand48(), jrand48(), srand48(), seed48(), and lcong48() functions record global state information for the random number generator, so they are not thread- safe. ## CONFORMING TOSVr4, POSIX.1-2001. ## NOTESThese functions are declared obsolete by SVID 3, which states that rand(3) should be used instead. ## SEE ALSOrand(3), random(3) ## COLOPHONThis page is part of release 3.65 of the Linux |

** All copyrights belong to their respective owners. Other content (c) 2014-2018, GNU.WIKI. Please report site errors to webmaster@gnu.wiki.Page load time: 0.088 seconds. Last modified: November 04 2018 12:49:43.**