*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: rand | Section: 3 | Source: UNIX v10 | File: rand.3
RAND(3) Library Functions Manual RAND(3) NAME rand, lrand, frand, nrand, srand - random number generator SYNOPSIS int rand() long lrand() double frand() int nrand(val) int val; srand(seed) int seed; DESCRIPTION Rand uses a linear feedback random number generator to return uniform pseudo-random numbers x, 0<=x<2^15, with period about 2^32. Lrand returns a uniform long x, 0<=x<2^31, with period about 2^48. Frand returns a uniform double x, 0.0<=x<1.0, always a multiple of 2^-31. Nrand returns a uniform integer x, 0<=x<val. The generators are initialized by calling srand with whatever you like as argument. To get a different starting value each time, srand((int)time((long *)0)); will work as long as it is not called more often than once per second. BUGS Rand and lrand are quite machine-dependent. Although frand and nrand are more portable, they appear in few versions of Unix. RAND(3)

Navigation Options