Home > Backend Development > PHP Tutorial > 固定随机数的算法

固定随机数的算法

WBOY
Release: 2016-06-13 12:53:02
Original
997 people have browsed it

求一个固定随机数的算法
有木有这样的函数 rand(min,max,randseed) 能根据随机指派的randseed参数,产生固定不变的min与max之间的数。
谁知道算法,请指点一下

随机数 算法
------解决方案--------------------
没有!
但 rand 可用 srand 设置种子
比如
srand(10);
echo rand(0, 10);

无论运行多少次,都只输出 5
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template