数学函数库:rand

rand

(PHP3 , PHP4)

rand ---&">nbsp; 产生乱数值

语法 : int rand( [int min] , [int max] );

说明 :

若无参数min与max,此函数传回的值会介于0和RAND_MAX之间。例如:您想让乱数值介于包含5和15之间,可使用rand(5,15)这种方式。在产生乱数值之前记得先使用srand()来设定乱数种子。

参考 : srand( )  getrandmax( )  mt_rand( )  mt_srand( )  mt_getrandmax( )

时间: 2024-09-05 19:25:42

数学函数库:rand的相关文章

数学函数库:mt_rand

mt_rand (PHP3 >= 3.0.6 , PHP4) mt_rand ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 取得乱数值 语法 : int mt_rand( [int min [ ,  int max] ]); 说明 : 许多老旧libc的乱数产生器有着含糊或未知的特性,且速度较慢:此函数使用速度快四倍以上的马其赛旋转(Mersenne Twister)来替代libc乱数产生器. 若无

数学函数库:srand

srand (PHP3 , PHP4) srand ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 设定乱数种子 语法 : void srand(int seed); 说明 : 设定乱数种子seed. Example : <?php // seed with microseconds since last "whole" second srand((double)microtime

数学函数库:decbin

decbin (PHP3 , PHP4) decbin ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 十进制转二进制 语法 : string decbin(int number); 说明 : 将参数number十进制的值转换成二进制的值,此函数传回的值为二进制的值.能转换的最大值为二进制的31个1或是十进制的2147483647. 参考 : bindec( )

数学函数库:max

max (PHP3 , PHP4) max ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 传回参数中最大值 语法 : mixed max(mixed arg1, mixed arg2, mixed argn); 说明 : 传回参数中的最大值,若第一个参数为数组,此函数会传回此数组的最大值,若第一个参数为整数.字符串或是浮点数,则至少需要二个参数且会传回这些值的最大值,参数的数目不受限制,可依使用者自行决定

数学函数库:mt_getrandmax

mt_getrandmax (PHP3 >= 3.0.6 , PHP4) mt_getrandmax ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 取得乱数最大值 语法 : int mt_getrandmax(void ); 说明 : 传回最大值,这可由呼叫mt_rand( )传回. 参考 : mt_rand( )  mt_srand( )  srand( )  rand( )  getrandma

数学函数库:getrandmax

getrandmax (PHP3 , PHP4) getrandmax ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 取得最大乱数值 语法 : int getrandmax(void ); 说明 : 传回最大值,这可由呼叫rand( )传回. 参考 : rand( )  srand( )  mt_rand( )  mt_srand( )  mt_getrandmax( )

数学函数库:mt_srand

mt_srand (PHP3 >= 3.0.6 , PHP4) mt_srand ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 设定乱数种子 语法 : void mt_srand(int seed); 说明 : 设定乱数种子seed. Example : <?php // seed with microseconds since last "whole" second mt

数学函数库:rad2deg

rad2deg (PHP3 >= 3.0.4 , PHP4) rad2deg ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 转换径度值为度数 语法 : double rad2deg (double number) 说明 : 此函数将number从径度转换成度数. 参考 : deg2rad( )

数学函数库:octdec

octdec (PHP3 , PHP4) octdec ---&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp; 八进制转十进制 语法 : int octdec(string octal_string); 说明 : 将参数octal_string八进制的值转为十进制的值,此函数传回的值为十进制的值.能转换的最大值为八进制的17777777777或是十进制的2147483647. 参考 : decoct( )