SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Ceil Math function

We can get the ceiling of a number by using match ceil() function. Or by using ceil math function we can get the smallest integer that is greater than or equal to given number. So by using this we can get the next higher integer of a given number. Here is the syntax.


Math.ceil(number)



Let us try with some examples.





document.write (Math.ceil(11.257)); // output 12
document.write ("<br>----<br>");

document.write (Math.ceil(1.56)); // output 2
document.write ("<br>----<br>");


document.write (Math.ceil(-3.564)); // output -3
document.write ("<br>----<br>");


document.write (Math.ceil(-7.164)); // output -7
document.write ("<br>----<br>");


You can read the php math ceil function
Further readings
random() function to generate random numbers
round() function to get rounded value of a number
IsNaN() function to check data if number or not
ceil() function to get just next higher integer
floor() function to get just highest lower integer
toFixed() function to format decimal places of a number
toPrecision() function to fix the places of a number
parseFloat() function to convert string to number
 
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.

Scripts
PHP
JavaScript
JavaScript Tutorials
Math Functions
Popular Tutorials
Drop down list
Timer function
JavaScript Tutorials
String
Array
Date & Time
Form Validation
Event Handling
Math Functions
Loops & structure
JavaScript Forum
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.