Ceil: 计算大于指定数的最小整数。
Floor: 计算小于指定数的最大整数。
round: 四舍五入。
根据需要选用
$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)."
"; //out 3
?>
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