SQL PHP HTML ASP JavaScript articles and free scripts to download
 

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


Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked


Join Our Email List
Email:  
For Email Newsletters you can trust
Math functions