rand.3

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3 代码 · 共 46 行

3
46
字号
.\" SCCSID: @(#)rand.3	8.2	1/28/91.TH rand 3.SH Namerand, srand \- random number generator.SH Syntax.nf.B #include <stdlib.h>.PP.B void srand(\fIseed\fP).B unsigned \fIseed\fP; .PP.B rand().fi.SH DescriptionThe newer .MS random 3should be used in new applications..NXR "rand subroutine (standard C)".NXR "srand subroutine".NXA "rand subroutine (standard C)" "random subroutine".NXR "random number generator"The.PN randsubroutine remains for compatibility..PPThe.PN randsubroutine uses a multiplicative congruentialrandom number generatorwith period 2\u\s732\s0\dto return successive pseudo-randomnumbers in the range from 0 to 2\u\s731\s10\d\-1..PPThe generator is reinitialized by calling.PN srandwith 1 as argument.It can be set to a random starting point by calling.PN srandwith whatever you like as argument..SH EnvironmentFor the System V environment, the.PN randsubroutine returns numbers in the range from 0 to 2\u\s715\s10\d\-1..SH See Alsorandom(3)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?