|
|
PHP floor() Math Functions
|
Tutorials » Php »
|
Topic |
What is floor Function?
|
|
Explanation |
|
The "floor()" function returns the value of a number rounded down to the nearest integer, even a negative
number is rounded to the next higher negative value.
Syntax:
floor(x)
In the above syntax "x" is the number to be rounded down to the nearest integer.
Example:
<?php
echo floor(10.1) . "\n";
echo floor(-6.2);
?>
Result:
10
-7
In the above example the numbers "10.1", "-6.2" are rounded to the nearest integer "10", "6".
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|