| |
|
Floor function to get just lower integer of a number |
We can use math function floor to get the floor of a number or the largest integer which is equal to or lower than the given number.
So by using floor we can get the floor value of an number.
Here is the syntax.
Math.floor(number)
Let us try with some examples.
document.write (Math.floor(11.257)); // output 11
document.write ("<br>----<br>");
document.write (Math.floor(1.56)); // output 1
document.write ("<br>----<br>");
document.write (Math.floor(-3.564)); // output -4
document.write ("<br>----<br>");
document.write (Math.floor(-7.164)); // output -8
document.write ("<br>----<br>");
You can read the php math floor function
| |
| Subscribe |
|
Submit your email address and receive
article and product notifications. Your email is safe with us.
|
|
|
|
| JavaScript Tutorials |
| Math Functions |
|
|
|
| Popular Tutorials |
|
| Drop down list |
| Timer function |
| JavaScript Tutorials |
|
| String |
| Array |
| Date & Time |
| Form Validation |
| Event Handling |
| Math Functions |
| JavaScript Forum |
| Subscribe |
|
Submit your email address and receive
article and product notifications. Your email is safe with us.
|
|
|
|