]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
Remove outdated warning in NOTES; encourage the use of random(3) instead.
authorMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 3 Mar 2008 16:47:45 +0000 (16:47 +0000)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 3 Mar 2008 16:47:45 +0000 (16:47 +0000)
man3/rand.3

index 3d6e8cf53413b69e3a21576ac87b14421abc207d..43d85e96fa53be74417fe2586c17427368c65d40 100644 (file)
@@ -35,7 +35,7 @@
 .\"          with contribution from Francesco Potorti <F.Potorti@cnuce.cnr.it>
 .\" Modified 2003-11-15, aeb, added rand_r
 .\"
-.TH RAND 3 2007-07-26 "" "Linux Programmer's Manual"
+.TH RAND 3 2008-03-07 "" "Linux Programmer's Manual"
 .SH NAME
 rand, rand_r, srand \- pseudo-random number generator
 .SH SYNOPSIS
@@ -134,42 +134,9 @@ implementations, and on current implementations on different systems,
 the lower-order bits are much less random than the higher-order bits.
 Do not use this function in applications intended to be portable
 when good randomness is needed.
-.PP
-In
-.I Numerical Recipes in C: The Art of Scientific Computing
-(William H. Press, Brian P. Flannery, Saul A. Teukolsky, William
-T. Vetterling; New York: Cambridge University Press, 1992 (2nd ed.,
-p. 277)), the following comments are made:
-.PP
-.RS 4
-"If you want to generate a random integer between 1 and 10, you should
-always do it by using high-order bits, as in
-.in +4n
-.sp
-j = 1 + (int) (10.0 * (rand() / (RAND_MAX + 1.0)));
-.sp
-.in
-and never by anything resembling
-.in +4n
-.sp
-j = 1 + (rand() % 10);
-.sp
-.in
-(which uses lower-order bits)."
-.RE
-.PP
-Random-number generation is a complex topic.
-The
-.I Numerical Recipes in C
-book (see reference above)
-provides an excellent discussion of practical random-number generation
-issues in Chapter 7 (Random Numbers).
-.PP
-For a more theoretical discussion which also covers many practical issues
-in depth, see Chapter 3 (Random Numbers) in Donald E. Knuth's
-.IR "The Art of Computer Programming" ,
-volume 2 (Seminumerical Algorithms), 2nd ed.; Reading, Massachusetts:
-Addison-Wesley Publishing Company, 1981.
+(Use
+.BR random (3)
+instead.)
 .SH EXAMPLE
 POSIX.1-2001 gives the following example of an implementation of
 .BR rand ()