The ceiling function in mathematics, denoted as ⌈x⌉ or ceil(x), returns the smallest integer greater than or equal to a given real number x. It effectively rounds a number up to the nearest integer.

  • For positive numbers: Any fractional part causes rounding up.
    Example: ⌈2.3⌉ = 3, ⌈7.1⌉ = 8.

  • For negative numbers: It rounds toward zero (upward in value).
    Example: ⌈-2.3⌉ = -2, ⌈-7.6⌉ = -7.

  • For integers: The value remains unchanged.
    Example: ⌈5⌉ = 5.

This function is also known as rounding toward positive infinity and is widely used in computer science, finance, and discrete mathematics for ensuring values are not underestimated.

In Programming:

  • C#: Math.Ceiling(double) or Math.Ceiling(decimal) returns the smallest integer ≥ the input.

  • JavaScript: Math.ceil(x) performs the same operation.

  • Excel: CEILING.MATH(number, [significance], [mode]) rounds up to the nearest multiple of significance, with optional mode control for negative numbers.

Key Identity:

The ceiling function is related to the floor function by the identity:
⌈x⌉ = -⌊-x⌋.

This relationship helps in deriving ceiling values using floor operations.

🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › system.math.ceiling
Math.Ceiling Method (System) | Microsoft Learn
public: static System::Decimal Ceiling(System::Decimal d); ... A decimal number. ... The smallest integral value that is greater than or equal to d. Note that this method returns a Decimal instead of an integral type.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Math › ceil
Math.ceil() - JavaScript | MDN
The Math.ceil() static method always rounds up and returns the smallest integer greater than or equal to a given number.
Discussions

What is the purpose of the Floor and Ceiling Functions?
You'd be amazed how much we use the floor function in number theory. After all, our main area of concern is the natural numbers, so whenever we step outside them and use other kinds of math (which is all the time), we need a way to translate our answer back to the integers. One simple example: counting digits of numbers. The first n-digit number is always 10n-1, so if we have an unknown number x and want to know how many digits it has, what we're "really" asking is which two powers of 10 it lies between. Thus 10n-1 <= x <= 10n n-1 <= log x <= n Thus n-1 is floor(log x), or n is ceil(log x), whichever you like. We've answered our strictly integral question by stepping outside the integers, then using the floor function to step back in. These are base-10 logs, by the way. Counting digits is the one context in pure math where we use them. More on reddit.com
🌐 r/askmath
4
0
February 2, 2014
I just discovered this pattern in the floor and ceiling functions
de Morgan's laws but epic More on reddit.com
🌐 r/mathematics
19
401
June 28, 2023
Low-floor, High-ceiling Problems for High Schoolers
Here are some good & brief puzzles that can usually be solved in about the time it takes to drink a cup of coffee: http://www.datagenetics.com/blog/june22014/index.html Actually, many of the rest of the posts at datagenetics might provide some material for good challenges (the one about distributing passwords will open their eyes to the possibilities of polynomials!): http://www.datagenetics.com/blog.html Martin Gardner's Aha! Gotcha! (about paradoxes) and Aha! Insight! (about finding simpler ways to solve complex problems) is another good source of the type of puzzles you're seeking (especially the latter). There's also: MindYourDecision.com's Sunday Puzzles - Try springing the evil geometry puzzle on them! James Tanton's Curriculum Inspirations - Don't miss the video archive ! More on reddit.com
🌐 r/math
20
27
January 11, 2017
How to return the ceiling of a number without using ceil() function?
double ceil(double a) { auto b = double((long long)a); if (a < 0 || b == a) { return b; } else { return b+1; } } EDIT: fixed negative number behavior and casted to larger to integral type per u/bad_investor13 More on reddit.com
🌐 r/cpp_questions
22
5
September 12, 2023
People also ask

What does the CEILING.MATH function do?
The CEILING.MATH function rounds a number up to the nearest multiple of a specified significance. It ensures that the result is equal to or greater than the original number.
🌐
spreadsheetcenter.com
spreadsheetcenter.com › excel-functions › ceiling-math
Excel CEILING.MATH Function: Syntax, Examples & Practice | ...
Can you provide an example of using the CEILING.MATH function?
Sure! If you have the number 98 and you want to round it up to the nearest multiple of 10, you can use the following CEILING.MATH formula: =CEILING.MATH(98, 10). The result will be 100.
🌐
spreadsheetcenter.com
spreadsheetcenter.com › excel-functions › ceiling-math
Excel CEILING.MATH Function: Syntax, Examples & Practice | ...
In what scenarios is the CEILING.MATH function useful?
The CEILING.MATH function is useful in situations where you need to round numbers up to a specific multiple, such as in pricing calculations, quantity constraints, or any scenario that requires values to be rounded up to a defined granularity.
🌐
spreadsheetcenter.com
spreadsheetcenter.com › excel-functions › ceiling-math
Excel CEILING.MATH Function: Syntax, Examples & Practice | ...
functions of a real returning respectively the largest smaller and the smallest larger integer
{\displaystyle \lfloor x\rfloor =x-\{x\}}
{\displaystyle \lfloor x\rfloor =m}
{\displaystyle \lfloor x\rfloor }
{\displaystyle \lfloor x\rfloor \leq \lceil x\rceil ,}
In mathematics, the floor function is the function that takes as input a real number x, and gives as output the greatest integer less than or equal to x, denoted ⌊x⌋ or … Wikipedia
🌐
Wikipedia
en.wikipedia.org › wiki › Floor_and_ceiling_functions
Floor and ceiling functions - Wikipedia
February 5, 2026 - In mathematics, the floor function is the function that takes as input a real number x, and gives as output the greatest integer less than or equal to x, denoted ⌊x⌋ or floor(x). Similarly, the ceiling function maps x to the least integer greater than or equal to x, denoted ⌈x⌉ or ceil(x).
🌐
Microsoft Support
support.microsoft.com › en-us › office › ceiling-math-function-80f95d2f-b499-4eee-9f16-f795a8e306c8
CEILING.MATH function - Microsoft Support
The CEILING.MATH function rounds a number up to the nearest integer or, optionally, to the nearest multiple of significance.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › c# › c-sharp-math-ceiling-method
C# | Math.Ceiling() Method - GeeksforGeeks
July 11, 2025 - In C#, Math.Ceiling() is a Math class method. This method is used to find the smallest integer , which is greater than or equal to the passed argument. The Ceiling method operates both functionalities in decimal and double.
🌐
BrightChamps
brightchamps.com › home › math › algebra › floor and ceiling function
Floor and Ceiling Function | Explanation of Floor and Ceiling Functions
The floor function gives the largest whole number less than or equal to a value, while the ceiling function gives the smallest whole number greater than or equal to that value. What Is Algebra?
Published   September 14, 2025
🌐
Byu
byu-dept-clsresults-prd.amazon.byu.edu › math-floor-ceil
Math Floor and Ceil Functions Explained
April 1, 2025 - We cannot provide a description for this page right now
🌐
SpreadsheetWeb
spreadsheetweb.com › home › function: ceiling
Function: CEILING
May 29, 2019 - The Excel CEILING function is a Math formula that rounds a given number up to the nearest multiple of significance. This function is the predecessor of the CEILING.MATH function which was released in Excel 2013.
🌐
W3Schools
w3schools.com › c › ref_math_ceil.php
C Math ceil() Function
The ceil() function rounds a number UP to the nearest integer.
🌐
W3Schools
w3schools.com › jsref › jsref_ceil.asp
W3Schools.com
The Math.ceil() method rounds a number rounded UP to the nearest integer.
🌐
Corporate Finance Institute
corporatefinanceinstitute.com › home › resources › ceiling.math function
CEILING.MATH Function - Formula, Examples, How to Use
February 25, 2025 - The formula we will use is =CEILING.MATH(A2,B2). It rounds up A2 to the nearest multiple of B2 (that is items per container). The value derived will then be divided by the number of containers.
🌐
Omni Calculator
omnicalculator.com › math
Math Calculators
The ceiling function calculator explains all you need to know about this simple yet so useful math function!
🌐
MedCalc
medcalc.org › en › manual › ceil-function.php
CEIL function calculator and graph - MedCalc Manual
September 9, 2025 - CEIL(-1.6) equals -1 · Enter the argument(s) for the function, including the symbol x. Enter the minimum and maximum for the X-axis and for the Y-axis. To let the software define the Y-axis automatically, leave both input fields for the Y-axis empty. FLOOR function · ROUND function · INT function · MOD function · TRUNC function · List of Mathematical functions ·
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › find-ceil-ab-without-using-ceil-function
Find ceil of a/b without using ceil() function - GeeksforGeeks
September 20, 2022 - ceilVal = (a+b-1) / b · Using simple maths, we can add the denominator to the numerator and subtract 1 from it and then divide it by denominator to get the ceiling value.
🌐
Dot Net Perls
dotnetperls.com › math-ceiling-floor-vbnet
VB.NET - Math.Ceiling and Floor - Dot Net Perls
June 1, 2023 - Module Module1 Sub Main() ' Ceiling returns the next highest integer if a fraction part exists. Dim result As Double = Math.Ceiling(
🌐
Codecademy
codecademy.com › docs › c# › math functions › .ceiling()
C# (C Sharp) | Math Functions | .Ceiling() | Codecademy
March 31, 2023 - Math.Ceiling() is a class method that always rounds up to the next full integer.
🌐
LiveFlow
liveflow.com › product-guides › ceiling-math-function-in-excel-explained
CEILING.MATH Function in Excel: Explained
The CEILING.MATH function in Excel is used to round a number up to the nearest specified multiple. It is an updated version of the CEILING function, introduced in Excel 2013.