|
|
1.1 ! root 1: .TH RAND 3C "19 January 1983" ! 2: .SH NAME ! 3: rand, srand \- random number generator ! 4: .SH SYNOPSIS ! 5: .nf ! 6: .B srand(seed) ! 7: .B int seed; ! 8: .PP ! 9: .B rand() ! 10: .fi ! 11: .SH DESCRIPTION ! 12: .ft B ! 13: The newer random(3) should be used in new applications; ! 14: rand remains for compatibilty. ! 15: .ft R ! 16: .PP ! 17: .I Rand ! 18: uses a multiplicative congruential ! 19: random number generator ! 20: with period 2\u\s732\s0\d ! 21: to return successive pseudo-random ! 22: numbers in the range from 0 to 2\u\s731\s10\d\-1. ! 23: .PP ! 24: The generator is reinitialized by calling ! 25: .I srand ! 26: with 1 as argument. ! 27: It can be set to a random starting point by calling ! 28: .I srand ! 29: with whatever you like as argument. ! 30: .SH "SEE ALSO" ! 31: random(3)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.