Math ceil() JavaScript

Learn via video course
FREE
View all courses
JavaScript Course With Certification: Unlocking the Power of JavaScript
JavaScript Course With Certification: Unlocking the Power of JavaScript
by Mrinal Bhattacharya
1000
4.8
Start Learning
JavaScript Course With Certification: Unlocking the Power of JavaScript
JavaScript Course With Certification: Unlocking the Power of JavaScript
by Mrinal Bhattacharya
1000
4.8
Start Learning
Topics Covered

Overview

The Math.ceil() function in JavaScript uses the upward rounding method, which accepts a single input, the number to be rounded to the nearest integer.

Syntax of Math ceil() in javascript

The following is the syntax of ceil in javascript:

Parameters of Math ceil() in javascript

Math ceil in JavaScript accepts only a single parameter:

  • value: it is the value to be rounded by the upward rounding method.

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Return type of Math ceil() in javascript

Return type: int

Math ceil in JavaScript returns the number that has been rounded by the upward rounding method or we can say that it returns the smallest integer greater than or equal to the given number.

Exceptions Of Math ceil() In Javascript

  • A non-numeric string passed as parameter returns NaN.
  • An array with more than 1 integer passed as parameter returns NaN.
  • An empty variable passed as parameter returns NaN.
  • An empty string passed as parameter returns NaN.
  • An empty array passed as parameter returns NaN.

Scaler Placement Report and Statistics

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data

Example Of Math ceil() In Javascript

Output :

What Is Math ceil() In Javascript?

The ceil() is a JavaScript function that returns the lowest integer value that is greater than or equal to a given number. In other words, the ceil() method produces an integer value after rounding up a number. Because the ceil() function is a static function of the Math object, it must be called using the Math placeholder object.

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

More Examples

Using Math.ceil() for practical example

Output :

Explanation: As previously explained, math ceil in JavaScript will convert the integer by the upward rounding method and return that converted value.

Decimal adjustment

Output:

The above code is an example of decimal adjustment in javascript.

Browser compatibility

The Math.ceil() method in javascript is supported by all the browsers such as Chrome, Edge, Safari, Opera etc.

Conclusion

  • The Math ceil in JavaScript returns an integer in which the integer is rounded by the upward rounding method.
  • As the ceil() function is a static function of the Math object, it must be called using the Math placeholder object.

Scaler Placement Report and Statistics

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data

See Also

Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more