Omni calculator
Last updated:

Floor Function Calculator

Table of contents

What is the floor function in math?Properties of floor functionGraph of the floor functionFAQs

Omni's floor function calculator is here to save your sanity if you have always believed that floors have nothing to do with mathematics and you've suddenly discovered there's something called a floor function in math. In the article below, we will:

  • Intuitively explain what the floor function does to a number (with examples);

  • Discuss what the floor function graph looks like; and

  • Explain various useful properties of the floor function (never again will you have to wonder if the floor function is continuous!).

As a bonus, we explain how to type the floor function in LaTeX. Ready for a ride?

🙋 Satisfied? Looking for more? We also have a ceiling function calculator. Don't forget to visit it once you're done with this floor function calculator.

What is the floor function in math?

The floor function of a real number x is the greatest integer number that is less than or equal to x:

x=max{nZ:nx}\footnotesize \lfloor x\rfloor =\max \{n\in \mathbb {Z} \colon n\leq x \}

It follows that the floor function maps the set of real numbers to the set of integers: floor ⁣: RZ\operatorname{floor} \colon \ \mathbb R \to \mathbb{Z}. We will now go through some examples so that you can get how this definition works in practice.

🙋 In our floor function calculator, we used the most popular way of denoting the floor function: the square brackets [ ] with their top part missing ⌊x⌋. Sometimes, especially in programming languages, you can see the whole word typed: floor(x).


Example 1

Let's compute the floor of 21.321.3.

We pose the question dictated by the definition of the floor function: what are the integers that are less than (or equal to) 21.321.3?

There are lots of such integers: 21,20,19,18,21, 20, 19, 18, \ldots. But we need the biggest one. Clearly, it is 2121. So 21.3=21\lfloor 21.3 \rfloor = 21.

Example 2

Let's compute the floor of 77.

The integers that are less than or equal to 77 are: 7,6,5,7, 6, 5, \ldots. The biggest one is 77, so 7=7\lfloor 7 \rfloor = 7. Note how crucial it is here to remember the "or equal to" part of the definition!

Example 3

The last challenge — the floor of a negative number! Let's compute the floor of 1.3-1.3.

What are the integers that are less than (or equal to) 1.3-1.3?

If you think for a bit, you can easily see that the desired integers are 2,3,4,-2, -3, -4, \ldots. The biggest one is 2-2, and so 1.3=2\lfloor -1.3 \rfloor = -2.

As you can see in the above examples, we can also think of the floor function as rounding the number down to the nearest integer. That's the most intuitive way of understanding what the floor function does to a number. Many more rounding procedures are explained in our rounding calculator.

Now, if you want to see more examples, use our floor function calculator — just throw some numbers at it and see what it spits out.

Properties of floor function

The floor function has some important properties.

  • The floor of a number is less than a number but not too much:
x1<xx\footnotesize \qquad x−1 < \lfloor x \rfloor \leq x
  • A number is greater than its floor but not too much:
xx<x+1\footnotesize \qquad \lfloor x \rfloor \leq x < \lfloor x \rfloor + 1
  • Integers can be taken out of the floor freely:
x+n=x+n\footnotesize \qquad \lfloor x + n \rfloor =\lfloor x \rfloor + n
  • The floor function is idempotent:
x=x\footnotesize \qquad \lfloor \lfloor x \rfloor \rfloor = \lfloor x \rfloor
  • The floor function is non-decreasing:
xyxy\footnotesize \qquad x \leq y \Rightarrow \lfloor x \rfloor \leq \lfloor y \rfloor
  • The floor function is closely related to its sibling, the ceiling function x\lceil x \rceil:
x={xif xZx1if xZ\footnotesize \qquad \lfloor x\rfloor = \begin{cases} \lceil x\rceil & \text{if } x \in \mathbb Z \\ \lceil x\rceil - 1 & \text{if } x \notin \mathbb Z \end{cases}

Don't hesitate to test these claims with Omni's floor function calculator! Now, let's discuss the graph of the floor function.

Graph of the floor function

The floor function makes a funny graph: it belongs to the category of the so-called step-functions, and you can easily guess why if you take a look:

Graph of the floor function.
Omegatron, CC BY-SA 3.0, via Wikimedia Commons

Just in case, let's recall what the different dot symbols mean in the context of function graphs:

  • Filled dot means "including";
  • Empty dot means "not including".

For instance, at x=1x = 1 we see an empty dot at y=0y=0 and a filled dot at y=1y=1. This means that the value of the floor function at x=1x = 1 is equal to y=1y=1 and not y=0y=0.


Is the floor function continuous?

No, the floor function is not continuous: its points of discontinuity are all integer numbers.

Is the floor function one to one?

No, the floor function is not one-to-one. This is because the floor function maps the whole interval [n, n+1) to n. Hence, many numbers are mapped to one number. Technically speaking, the floor function is not injective.

How do I type floor function in LaTeX?

The LaTeX code for is \lfloor and that for is \rfloor. Hence, to get ⌊x⌋ you can type \lfloor x \rfloor.

What is the floor of pi?

The floor of the number pi is 3. This is because pi is approximately equal to 3.14, and so the greatest integer that is less than pi is 3.

How do I calculate the floor of a number?

To determine the floor of a number:

  1. If your number is an integer, it is equal to its floor. In other words, you're done!
  2. If you're dealing with a non-integer, then write down the integers that are smaller than your number.
  3. Pick the greatest among the integers you've found in the previous step.
  4. That's it! You've calculated the floor of your number.
Check out 75 similar arithmetic calculators ➗
Absolute changeAbsolute valueAdding and subtracting fractions...72 more