ceil
Description
Syntax
ceil( int|float $num ): float
Parameters
num
The value to round
Return
Returns num rounded up to the next highest integer. The return value of ceil() is still of type float as the value range of float is usually bigger than that of int.
Examples
1 · num · negative · high
<? $num = -1.9999; $return = ceil($num); echo $return;
-1
2 · num · negative · low
<? $num = -1.0001; $return = ceil($num); echo $return;
-1
3 · num · non-negative · low
<? $num = 1.0001; $return = ceil($num); echo $return;
2
4 · num · non-negative · high
<? $num = 1.9999; $return = ceil($num); echo $return;
2