RAND
Section: C Library Functions (3)
Index
Return to Main Contents
BSD mandoc
NAME
rand
srand
- bad random number generator
SYNOPSIS
Fd #include <stdlib.h>
Ft void
Fn srand unsigned seed
Ft int
Fn rand void
DESCRIPTION
Bf -symbolic
These interfaces are obsoleted by random(3).
Ef
The
Fn rand
function computes a sequence of pseudo-random integers in the range
of 0 to
RAND_MAX
(as defined by the header file
Aq Pa stdlib.h ) .
The
Fn srand
function sets its argument as the seed for a new sequence of
pseudo-random numbers to be returned by
Fn rand .
These sequences are repeatable by calling
Fn srand
with the same seed value.
If no seed value is provided, the functions are automatically
seeded with a value of 1.
SEE ALSO
random(3)
STANDARDS
The
Fn rand
and
Fn srand
functions
conform to
St -ansiC .
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- SEE ALSO
-
- STANDARDS
-
This document was created by
man2html,
using the manual pages.
Time: 15:52:53 GMT, January 15, 2023