Floor and ceiling functions are two important functions that are used frequently in mathematics and computing. The floor function assigns to each input an integer number that is equal or less than the input. The ceiling function assigns to each input an integer number that is equal or greater than the input.

In this article, we will look at more detailed definitions of these functions. We will also learn about their properties. Finally, we will look at their graphs along with several examples with answers.

ALGEBRA
floor and ceiling functions

Relevant for

Learning about the floor and ceiling functions.

See formulas

ALGEBRA
floor and ceiling functions

Relevant for

Learning about the floor and ceiling functions.

See formulas

Definition of floor and ceiling functions

Definition of ceiling function

A ceiling function is a function in which the smallest successive integer is returned. In other words, the ceiling function of a real number x is the smallest integer that is greater than or equal to the number x.

The notation used to represent the ceiling function is \lceil ~ \rceil. Therefore, the ceiling function is written as f(x)=\lceil x \rceil.

Definition of floor function

The floor function is defined as a function that returns the largest integer that is less than or equal to x. The notation used to represent the floor function is \lfloor ~ \rfloor. Therefore, the floor function is written as f(x)=\lfloor x \rfloor.

EXAMPLES

  •  \lceil 2.5 \rceil=3
  •  \lfloor 2.5 \rfloor=2
  •  \lceil 4.85 \rceil=5
  •  \lfloor 4.85 \rfloor=4

Properties of floor and ceiling functions

The floor and ceiling functions have many useful and interesting properties. The following are some of the most important. Here, n is an integer:

  • \lfloor x \rfloor=n only if n\leq x<n+1
  • \lceil x \rceil=n only if n-1<x\leq n
  • \lfloor x \rfloor=n only if x-1< n\leq x
  • \lceil x \rceil=n only if x\leq n<x+1
  • \lceil -x \rceil=-\lceil x \rceil
  • \lfloor -x \rfloor=-\lfloor x \rfloor
  • \lceil x+n \rceil=\lceil x \rceil +n
  • \lfloor x+n \rfloor=\lfloor x \rfloor +n

Formulas of floor and ceiling functions

Ceiling function formula

The formula to find the ceiling value for any specified value is:

f(x)= minimum {a \in Z; a \geq x}

This means that the function returns the minimum integer that is greater than or equal to x. This is represented by:

f(x)=<\lceil x \rceil = smallest successive integer of x

Floor function formula

The formula to find the floor value for any specified value is:

f(x)= minimum {a \in Z; a \geq x}

This means that the function returns the maximum integer that is less than or equal to x. This is represented by:

f(x)= \lfloor x \rfloor = greatest successive integer of x


Graphs of floor and ceiling functions

The graphs of the floor and ceiling functions have a shape that resembles stairs and have a discontinuity at each whole number point.

The following is the graph of the floor function:

graph of floor function

The following is the graph of the ceiling function:

graph of ceiling function

Floor and ceiling functions – Examples with answers

EXAMPLE 1

Apply the ceiling function to 3.4 and to -3.4.

Solution: We have f(3.4)=\lceil 3.4 \rceil=4 and f(-3.4)=\lceil -3.4 \rceil=-3.

The ceiling function of a real number is the smallest integer that is greater than or equal to x. In the case of 3.4, the larger integers are 4, 5, 6… The smallest of these is 4.

In the case of -3.4, the larger integers are -3, -2, -1, … The smallest of these is -3.

EXAMPLE 2

What is the result of \lfloor \sqrt{46} \rfloor?.

Solution: In this case, we have to find the largest integer that is equal to or less than  \sqrt{46}.

We know that   \sqrt{36}<\sqrt{46}<\sqrt{49}.

Therefore, we have  6<\sqrt{46}<7.

This means that, \lfloor \sqrt{46} \rfloor=6.

EXAMPLE 3

Solve the equation \lfloor x-\frac{1}{2} \rfloor +\lfloor x-\frac{5}{2} \rfloor +\lfloor x-\frac{9}{2} \rfloor =3.

Solution: We can solve this problem more easily by using the substitution x-\frac{1}{2}=z. Therefore, we have the equation:

\lfloor z \rfloor +\lfloor z-2 \rfloor +\lfloor z-4 \rfloor =3

Using the identity \lfloor x+n \rfloor =\lfloor x \rfloor +n, we have the following:

\lfloor z \rfloor +\lfloor z \rfloor -2+\lfloor z \rfloor -4=3

⇒   3\lfloor z \rfloor =9

⇒   \lfloor z \rfloor =3

The last equation means that 3\leq z<4. When returning to the variable  x, we have:

3\leq x-\frac{1}{2}<4

⇒   3\frac{1}{2}\leq x<4\frac{1}{2}

⇒  x\in[3.5, 4.5)


Floor and ceiling functions – Practice problems

What is the result of \lfloor 3.4 \rfloor?

Choose an answer






What is the result of \lfloor -\pi \rfloor?.

Choose an answer






What is the value of \lceil \sqrt{61} \rceil?

Choose an answer







See also

Interested in learning more about functions? Take a look at these pages:

Learn mathematics with our additional resources in different topics

LEARN MORE