* Mathematical Functions
1,abs () to find the absolute value
2,ceil () into a method to take the whole
3,floor () de-rounding
4,fmod () to take a floating-point number for example Fmod (5.7,1.3)
5,pow () returns the n-th square pow (1,20)
6,round () floating point rounding round (1.98765,2) = = 1.99
7,SQRT (9) to find the square root, the value is 3
8,max (), Min. max, Min max (1,2,3,4) = = 4
9, Mt_rand () better random number Mt_rand (1,10) returns a random number within 1 to 100
RAND () returns the random number in a range rand (1,10)
Pi () returns the PI value
* */
<?PHP$num= '-123456 ';Echo ABS($num);//Absolute Value functionEcho"<br>";$num 1= ' 1.123 ';Echo Ceil($num 1);//the output of an integer function is 2.Echo"<br>";Echo Floor($num 1);//Rounding out the whole output of the method is 1Echo"<br>";Echo Fmod(5.7,1.3);//The value of the fmod (5.7,1.3) output for a floating-point number is the remainder of the 5.7/1.3Echo' <br> ';Echo POW(2,5);//returns a number of n-th squareEcho"<br>";Echo round(3.4);//The method of rounding out floating-point numbers/*Echo Round (3.6, 0); 4echo round (1.95583, 2); 1.96echo round (1241757,-3); 1242000echo round (5.045, 2); 5.05echo round (5.055, 2); 5.06*/Echo' <br> ';Echo sqrt(9);//The output is the square root of a numberEcho"<br>";Echo min(1,2,4,5,-1);//the output is -1.Echo Max(54,4,7,6);//the output is aEcho"<br>";Echo Mt_rand(1,100);//The output is a random number from 1 to 100.Echo"<br>";Echo Rand();//This is also a random function, just the output of the number range is not so large/*: Under some platforms (e.g. Windows) Rand_max is only 32768. If the required range is greater than 32768, then specifying the min and Max parameters can generate a number greater than Rand_max, or consider replacing it with Mt_rand (). * */Echo' <br> ';Echo Pi();//the function of the output is Pi
The practice of PHP math functions