Php rounding function. Here we have collected a large number of rounding functions in php, including round (), ceil (), and floor (). If you need them, please refer to them. The code is as follows: Copy the code? Php $ srand (100,200); $ pipi () describes a large number of rounding functions in php, including round (), ceil (), and floor, for more information, see.
| The code is as follows: |
|
$ S = revert (100,200 ); $ Pi = pi (); $ R = sqrt ($ s/$ pi ); $ Qz1 = round ($ r); // rounding to get an integer $ Qz2 = ceil ($ r); // perform an integer operation in one step. $ Qz3 = floor ($ r); // rounds the result Echo "the area of the randomly generated circle is:". $ s ." "; Echo "the radius of the circle calculated by division and the open side is:". $ r ." "; Echo "rounded up:". $ qz1 ." "; Echo "after an integer is obtained:". $ qz2 ." "; Echo "rounded up:". $ qz3 ." "; ?> |
Margin (), ceil (), floor (), etc. if you need it, please refer to it. The code is as follows? Php $ s = rand (100,200); $ pi = pi ()...