Difference between ceil and floor : Math Functions « Math « PHP






Difference between ceil and floor


<?
$my_double = 4.7;
$my_int = ceil($my_double); 
echo($my_int);


$my_double = -4.7;
$my_int = floor($my_double);
echo($my_int);

 
?>
           
       








Related examples in the same category

1.rand demo
2.Exp
3.Using the arbitrary-precision functions for exact integer arithmetic
4.Floor in action
5.Round in action
6.Get the Power
7.sqrt