Ceiling Function Calculator
Table of contents
Ceiling function in mathExamples of ceiling function computationGraph of the ceiling functionFAQsWelcome to Omni's ceiling function calculator — the perfect place to fall in love with this popular math operation. In the short article below, we not only give the formal definition of the ceiling function but also:
- Explain intuitively what the ceiling function does to a number;
- Show how to graph the ceiling function;
- Discuss what the most popular symbol for the ceiling function is; and
- Go together through some examples of ceiling function computation.
Ceiling function in math
The ceiling function maps a real number x
to the smallest integer number that is greater than or equal to x
:
🙋 In the formula above, you can see the most widespread ceiling function symbol. It looks like square brackets [ ]
with their bottom part missing (so what remains is the... ceiling! Clever, right?). In programming languages, you most often find this function under the command ceil(x)
. In fact, that is the basis of the algorithms behind our digital root calculator and Egyptian fractions calculator.
To get a better understanding of the ceiling function definition, let's go through a few examples together.
Examples of ceiling function computation
Example 1
Let's compute the ceiling of .
We pose the question dictated by the definition of the ceiling function: what are the integers that are greater than (or equal to) ?
There are lots of such integers: . But we need the smallest one. Clearly, it is . So . Don't forget that you can verify this result with the ceiling function calculator!
Example 2
Let's compute the ceiling of .
The integers that are greater than or equal to are: . The smallest one is , so . Note how crucial it is here to remember the "or equal to" part of the definition!
Example 3
The last challenge — the ceiling of a non-integer negative number! Let's compute the ceil of .
What are the integers that are greater than (or equal to) ?
If you think for a bit, you can easily see that the desired integers are . The smallest one is , and so .
As you can see from what we calculated above, the ceiling function takes a number and rounds it to the nearest integer (a special case of what we do in the rounding calculator). If we're already at an integer, there's no need for rounding, and so the ceil function does not affect integers. Logical, right?
🙋 Not enough examples? To generate more, you can put random numbers into our ceiling function calculator and see what comes out!
Graph of the ceiling function
Once you're done playing with our ceiling function calculator, it's high time we discuss how to graph the ceiling function. Here it is, in all its glory:
Looking at it, you can easily guess why we say that the ceiling function (along with its cousin, the floor function) belongs to the family of so-called step-functions.
What does the ceil function do?
The ceil function transforms a real number into the smallest integer that is greater than or equal to this number. It's like rounding a number up to the nearest integer.
What is the domain of the floor and ceiling function?
The domain of the floor and ceiling function is the set of all real numbers. The image, in turn, is the set of integers.
How do I type the ceiling function in LaTeX?
The LaTeX code for ⌈
is \lceil
, and for ⌉
it's \rceil
. Hence, to get ⌈x⌉
, you can type \lceil x \rceil
.
What is the ceiling of pi?
The ceiling of the number pi is 4. This is because pi is approximately equal to 3.14
, and so the smallest integer that is greater than pi is 4
.
How do I calculate the ceiling of a number?
To determine the ceiling of a number:
- If your number is an integer, then the ceiling is equal to this number. You're done!
- Otherwise, write down the integers that are greater than your number.
- Pick the smallest of the integers you've written down.
- That's it! You've found the ceiling of your number.