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

Detailed explanation of integer functions in PHP_PHP Tutorial

WBOY
Release: 2016-07-21 15:07:46
Original
858 people have browsed it

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...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template