The greatest integer function also known as the floor function gives the greatest integer less than or equal to its argument the floor of is usually denoted by or the action of this function is the same as rounding down on a positive argument this function is the same as dropping everything after the decimal point but this is not true for negative values.
Php floor function.
View the example in the browser.
This function accepts any float number as argument and rounds it down to the next lowest integer.
To round a floating point number look at the round function.
To go lower the floor function would go to 2 which is logically less than 1 6.
In reply to glen who commented.
Will output 1.
It accepts only a single parameter number that is the nearest integer.
A function will not execute automatically when a page loads.
The floor function rounds a number down to the nearest integer if necessary and returns the result.
The result will be rounded to 7.
This function always returns a float number as range of float is bigger than that of integer.
The result will be rounded to 2.
The floor function converts the given numeric value to the next lower integer.
Glen 01 dec 2007 04 22 php echo floor 1 6.
Floor isn t trying to give you the number closest to zero it s giving you the lowest bounding integer of a float.
The floor function works in the inverse of the ceil this rounds the fractional values down.
Php floor function is used to round a given input number down to the nearest integer.
A function is a block of statements that can be used repeatedly in a program.
Besides the built in php functions it is possible to create your own functions.
What is php floor function.
The floor function is another in built function in php iterpreter.
Php user defined functions.
See example of php floor function.
A function will be executed by a call to the function.
If we take the same example previously described we will have the following results.
As in 1 is logically greater than 1 6.