OSDN Git Service

(split) LDP: Update original to LDP v3.52.
[linuxjm/LDP_man-pages.git] / original / man3 / drand48.3
index 3dad8fc..a9e7bb2 100644 (file)
@@ -27,7 +27,7 @@
 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
 .\"     386BSD man pages
 .\" Modified Sat Jul 24 19:46:03 1993 by Rik Faith (faith@cs.unc.edu)
 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
 .\"     386BSD man pages
 .\" Modified Sat Jul 24 19:46:03 1993 by Rik Faith (faith@cs.unc.edu)
-.TH DRAND48 3  2007-07-26 "" "Linux Programmer's Manual"
+.TH DRAND48 3  2013-06-21 "" "Linux Programmer's Manual"
 .SH NAME
 drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48,
 lcong48 \- generate uniformly distributed pseudo-random numbers
 .SH NAME
 drand48, erand48, lrand48, nrand48, mrand48, jrand48, srand48, seed48,
 lcong48 \- generate uniformly distributed pseudo-random numbers
@@ -118,7 +118,8 @@ do not require
 an initialization function to be called first.
 .PP
 All the functions work by generating a sequence of 48-bit integers,
 an initialization function to be called first.
 .PP
 All the functions work by generating a sequence of 48-bit integers,
-\fIXi\fP, according to the linear congruential formula:
+.IR Xi ,
+according to the linear congruential formula:
 .sp
 .nf
 .RS
 .sp
 .nf
 .RS
@@ -126,10 +127,16 @@ All the functions work by generating a sequence of 48-bit integers,
 .RE
 .fi
 .sp
 .RE
 .fi
 .sp
-The parameter \fIm\fP = 2^48, hence 48-bit integer arithmetic is performed.
+The parameter
+.I m
+= 2^48, hence 48-bit integer arithmetic is performed.
 Unless
 .BR lcong48 ()
 Unless
 .BR lcong48 ()
-is called, \fIa\fP and \fIc\fP are given by:
+is called,
+.IR a
+and
+.I c
+are given by:
 .sp
 .nf
 .RS
 .sp
 .nf
 .RS
@@ -147,9 +154,13 @@ The value returned by any of the functions
 or
 .BR jrand48 ()
 is
 or
 .BR jrand48 ()
 is
-computed by first generating the next 48-bit \fIXi\fP in the sequence.
+computed by first generating the next 48-bit
+.I Xi
+in the sequence.
 Then the appropriate number of bits, according to the type of data item to
 Then the appropriate number of bits, according to the type of data item to
-be returned, is copied from the high-order bits of \fIXi\fP and transformed
+be returned, is copied from the high-order bits of
+.I Xi
+and transformed
 into the returned value.
 .PP
 The functions
 into the returned value.
 .PP
 The functions
@@ -158,49 +169,94 @@ The functions
 and
 .BR mrand48 ()
 store
 and
 .BR mrand48 ()
 store
-the last 48-bit \fIXi\fP generated in an internal buffer.
+the last 48-bit
+.I Xi
+generated in an internal buffer.
 The functions
 .BR erand48 (),
 .BR nrand48 ()
 and
 .BR jrand48 ()
 require the calling
 The functions
 .BR erand48 (),
 .BR nrand48 ()
 and
 .BR jrand48 ()
 require the calling
-program to provide storage for the successive \fIXi\fP values in the array
-argument \fIxsubi\fP.
+program to provide storage for the successive
+.I Xi
+values in the array
+argument
+.IR xsubi .
 The functions are initialized by placing the initial
 The functions are initialized by placing the initial
-value of \fIXi\fP into the array before calling the function for the first
+value of
+.I Xi
+into the array before calling the function for the first
 time.
 .PP
 The initializer function
 .BR srand48 ()
 sets the high order 32-bits of
 time.
 .PP
 The initializer function
 .BR srand48 ()
 sets the high order 32-bits of
-\fIXi\fP to the argument \fIseedval\fP.
+.I Xi
+to the argument
+.IR seedval .
 The low order 16-bits are set
 to the arbitrary value 0x330E.
 .PP
 The initializer function
 .BR seed48 ()
 The low order 16-bits are set
 to the arbitrary value 0x330E.
 .PP
 The initializer function
 .BR seed48 ()
-sets the value of \fIXi\fP to
-the 48-bit value specified in the array argument \fIseed16v\fP.
+sets the value of
+.I Xi
+to
+the 48-bit value specified in the array argument
+.IR seed16v .
 The
 The
-previous value of \fIXi\fP is copied into an internal buffer and a
+previous value of
+.I Xi
+is copied into an internal buffer and a
 pointer to this buffer is returned by
 .BR seed48 ().
 .PP
 The initialization function
 .BR lcong48 ()
 allows the user to specify
 pointer to this buffer is returned by
 .BR seed48 ().
 .PP
 The initialization function
 .BR lcong48 ()
 allows the user to specify
-initial values for \fIXi\fP, \fIa\fP and \fIc\fP.
+initial values for
+.IR Xi ,
+.I a
+and
+.IR c .
 Array argument
 Array argument
-elements \fIparam[0-2]\fP specify \fIXi\fP, \fIparam[3-5]\fP specify
-\fIa\fP, and \fIparam[6]\fP specifies \fIc\fP.
+elements
+.I param[0-2]
+specify
+.IR Xi ,
+.I param[3-5]
+specify
+.IR a ,
+and
+.I param[6]
+specifies
+.IR c .
 After
 .BR lcong48 ()
 has been called, a subsequent call to either
 .BR srand48 ()
 or
 .BR seed48 ()
 After
 .BR lcong48 ()
 has been called, a subsequent call to either
 .BR srand48 ()
 or
 .BR seed48 ()
-will restore the standard values of \fIa\fP and \fIc\fP.
+will restore the standard values of
+.I a
+and
+.IR c .
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR drand48 (),
+.BR erand48 (),
+.BR lrand48 (),
+.BR nrand48 (),
+.BR mrand48 (),
+.BR jrand48 (),
+.BR srand48 (),
+.BR seed48 (),
+and
+.BR lcong48 ()
+functions record global state information for the random number generator,
+so they are not thread-safe.
 .SH CONFORMING TO
 SVr4, POSIX.1-2001.
 .SH NOTES
 .SH CONFORMING TO
 SVr4, POSIX.1-2001.
 .SH NOTES