Home  >  Article  >  Backend Development  >  Detailed explanation of integer functions in PHP_PHP Tutorial

Detailed explanation of integer functions in PHP_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:07:46790browse

Ceil: Calculates the smallest integer greater than the specified number.
Floor: Calculates the largest integer less than the specified number.
round: Rounded.

Choose

Copy code as needed. The code is as follows:

$a=20;
$b = 6;
echo ($a/$b)."
"; //out 3.3333333333333
echo ceil($a/$b). "
"; //out 4
echo floor($a/$b)."
"; //out 3
echo round($a/$b)."< ;br>"; //out 3
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327518.htmlTechArticleCeil: Calculate the smallest integer greater than the specified number. Floor: Computes the largest integer less than the specified number. round: rounded. Copy the code as needed. The code is as follows: ?php $a=20; $b = 6...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn