Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #523
Difficulty: Medium
Some programming languages implement strings by defining arrays of characters.
True or False?
Linux & Unix Commands - Search Man Pages

irand(3f) [bsd man page]

RAND(3F)																  RAND(3F)

rand, drand, irand - return random values SYNOPSIS
function irand (iflag) function rand (iflag) double precision function drand (iflag) DESCRIPTION
The newer random(3f) should be used in new applications; rand remains for compatibilty. These functions use rand(3C) to generate sequences of random numbers. If iflag is '1', the generator is restarted and the first random value is returned. If iflag is otherwise non-zero, it is used as a new seed for the random number generator, and the first new random value is returned. Irand returns positive integers in the range 0 through 2147483647. Rand and drand return values in the range 0. through 1.0 . FILES
/usr/lib/libF77.a SEE ALSO
random(3F), rand(3C) BUGS
The algorithm returns a 15 bit quantity on the PDP11; a 31 bit quantity on the VAX. Irand on the PDP11 calls rand(3C) twice to form a 31 bit quantity, but bit 15 will always be 0. 4.2 Berkeley Distribution May 15, 1985 RAND(3F)

Check Out this Related Man Page

rand(3UCB)					     SunOS/BSD Compatibility Library Functions						rand(3UCB)

rand, srand - simple random number generator SYNOPSIS
/usr/ucb/cc [ flag ... ] file ... int rand(); int srand(seed) unsigned seed; DESCRIPTION
rand() uses a multiplicative congruential random number generator with period 2^32 to return successive pseudo-random numbers in the range from 0 to 2^31 -1. srand() can be called at any time to reset the random-number generator to a random starting point. The generator is initially seeded with a value of 1. SEE ALSO
cc(1B), drand48(3C), rand(3C), random(3C) NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system libraries or in multi-thread applications is unsupported. The spectral properties of rand() leave a great deal to be desired. drand48(3C) and random(3C) provide much better, though more elaborate, random-number generators. The low bits of the numbers generated are not very random; use the middle bits. In particular the lowest bit alternates between 0 and 1. SunOS 5.11 30 Oct 2007 rand(3UCB)

Featured Tech Videos