View Help documents primarily
Name of function |
Description |
Example |
input |
Output |
ABS () |
Seek absolute value |
$abs = ABS (-4.2); 4.2 |
Digital |
Absolute number |
Ceil () |
into a method to take the whole |
echo ceil (9.999); 10 |
Floating point number |
into a rounding |
Floor () |
Rounding out the whole method of rounding |
echo Floor (9.999); 9 |
Floating point number |
Go directly to the decimal parts |
Fmod () |
Floating-point number to take surplus |
" x = 5.7 x = 5.7 ; y = 1.3; r=fmod( r = f m o d ( X y ) ; < span class= "Mo" id= "mathjax-span-23" style= "Font-family:mathjax_main;" >/ / y ) ; / / R equals 0.5, because 4 * 1.3 + 0.5 = 5.7 " |
Two floating-point numbers, x>y |
Floating-point remainder |
POW () |
Returns the number of the n-th square |
Echo Pow (-1, 20); 1 |
Base number n-th square |
exponentiation value |
Round () |
Floating-point rounding |
Echo Round (1.95583, 2);//1.96 |
A numeric value |
How many bits are reserved after the decimal point, the default is 0 rounded results |
sqrt () |
Find square root |
echo sqrt (9); 3 |
The number of the being prescribed |
Square root |
Max () |
To find the maximum value |
"Echo Max (1, 3, 5, 6, 7); 7 echo Max (Array (2, 4, 5)); 5 " |
Multiple numbers or arrays |
Returns the maximum value |
Min () |
To find the minimum value |
Min |
Multiple numbers or arrays |
Returns the minimum value |
Mt_rand () |
A better random number |
echo Mt_rand (0,9);//n |
Min/MAX, random number |
Values in the range returned randomly |
RAND () |
Random number |
echo rand () |
Min/MAX, random number |
Values in the range returned randomly |
Pi () |
Get the PI value |
echo Pi (); 3.1415926535898 |
No |
Get pi |
From for notes (Wiz)
Front-end PHP entry -019-mathematical functions of built-in functions-very important