PHP数学函数(全)

来源:互联网 发布:mac如何复杂黏贴文件 编辑:程序博客网 时间:2024/04/28 08:19


数学函数
Abs
函数描述:mixed abs(mixed number);
返回值:函数abs返回参数number的绝对值。
Acos
函数描述:double acos(double number);
返回值:函数acos返回参数number的反余弦值。如果参数number大于1或小于1,

则其反余弦值无意义 。
Acosh --
反双曲余弦
Asin
函数描述;double asin(double number);
返回值:函数asin返回参数number的反正弦值。如果参数number大于1或小于1,

则其反正弦值无意义 。
Asinh --
反双曲正弦
Atan
函数描述:double atan(double number);
函数atan返回参数number的反正切值。
Atan2
函数描述:Double atan2(double x , double y);
返回值:函数atan2返回由直角坐标系指定的座标点在极座标系中的角度的弧度

值。
Atan --
反正切
Atanh --
反双曲正切
BinDec
函数描述:int bindec(string binary_number);
返回值:函数bindec返回一个用二进制数写成的字符串binary_number的整数值

。PHP使用32位带符号的整数,其二进制数的第一位是符号位。
Base_convert --
在任意进制之间转换数字
Ceil
函数描述:int ceil(double number);
返回值:函数ceil返回大于参数number 的最小整数;若number为整数。,则返

回其本身。
Cos
函数描述:double cos(double angle);
返回值:函数cos返回以弧度的大小为参数angle的角的余弦值。
Cosh --
双曲余弦
DecBin
与Bindec相反,将十进制转为二进制。
DecHex(<->HexDec)
返回十六进制值
DecOct(<->OctDec)
返回八进制值
Deg2rad(<->Rad2reg)
函数描述:double deg2red(double angle);
返回值:函数deg2red返回角度数angle相对应的弧度值。
Exp
函数描述:double exp(double power);
返回值:函数exp返回自然对数的power次幂。
Expm1 --  
返回 Exp(number) - 1,甚至当 number 的值接近零也能计算出准确结果
Floor
函数描述:int floor(double number);
返回值:返回参数number的整数部分。
Fmod --
返回除法的浮点数余数
Getrandmax
函数描述:int getrandmax();
返回值;返回由函数rand所能返回的最大值
Hexdec --
十六进制转换为十进制
Hypot --
返回 sqrt( num1*num1 + num2*num2)
Is_finite --
判断是否为有限值
Is_infinite --
判断是否为无限值
Is_nan --
判断是否为合法数值
Log(Log10)
函数描述:Double log(double number);
返回值:返回参数number的自然对数(返回以10为底的对数)
Lcg_value --
组合线性同余发生器
Log10 --
以 10 为底的对数
Log1p --  
返回 log(1 + number),甚至当 number 的值接近零也能计算出准确结果
Max (<->Min)
函数描述:mixed max(mixed arg1, mixed arg2, …,mixed argn);
返回值:返回此数组中的最大值(最小值),若参数中有浮点数,则所有参数转

化成浮点数,返回值也为浮点数;否则所有参数转化成整数,返回值为整数。
Pi
函数描述:double pi();
返回值:函数pi返回圆周率的近似值。
Pow
函数描述:double pow(double base,double power);
返回值:函数pow返回参数base的power次幂。
Rand
函数描述:int rand(int lowest,int longest);
说明:函数rand使用前要用srand激活。产生一个随机数。
返回值:函数rand返回可选参数lowest和longest之间的一个数(包含两个参数

);若无参数,则返回值的范围从零到getrandmax返回的整数。
Rad2deg --  
将弧度数转换为相应的角度数
Round
函数描述:double round(double number);
返回值:函数round返回最接近参数number的整数。
Sin
函数描述:double sin(double angle);
返回值:函数sin返回一个用弧度表示的角的正弦值。
Sinh --
双曲正弦
Sqrt
函数描述:double sqrt(double number);
说明:在函数sqrt中,参数number不能小于0。
返回值:函数sqrt返回参数number的平方根。
Srand
函数描述:srand(int seed);
说明:函数srand激活随机数发生器。参数seed是随机产生的种子,即所得的随

机数是由参数经过一系列计算所的。
返回值:无。
Tan
函数描述:double tan(duoble angle);
返回值:函数tan返回以弧度表示的角的正切值。
Tanh —
双曲正切