Floor Function

Last Updated : 23 Jul, 2025

The floor function is a mathematical function that returns the greatest integer less than or equal to a given number. In other words, it rounds a real number down to the largest integer less than or equal to the given number. This function is widely used in maths, computer science, and many other fields.

The floor function is often denoted by ⌊x⌋ or floor(x), where x is the number operated on.

Mathematically, the floor function is defined as follows:

Floor(x) OR ⌊x⌋ = max{n ∈ Z : n ≤ x}

Where:

  • Z represents the set of all integers.
  • n is the greatest integer that is less than or equal to x.

The graph below illustrates how the floor function works. For example, ⌊3.5⌋ = 3, as the greatest integer less than or equal to 3.5 is 3.

Floor
Floor Function in Number line

For example:

  • ⌊3.5⌋ = 3, because 3 is the greatest integer less than or equal to 3.5.
  • ⌊−2.4⌋ = −3, because -3 is the greatest integer less than or equal to -2.4.

Note: The floor and ceiling of an integer are the integer itself. For example, the floor and ceiling of 5 will both be 5.

Floor Function Symbol

The ceiling function is denoted using the symbol ⌊ ⌋. Thus we can denote Floor(x) by ⌊ x ⌋. Other than this, floor function is also denoted by Floor(x).

Domain and Range

The domain of a function is the set of all possible input values, while the range is the set of all possible output values.

  • Domain: The floor function is defined for all real numbers. Thus, its domain is R.
  • Range: The output of the floor function is always an integer. Hence, its range is Z.
Floor-function
Domain and Range of Floor Function

Read More: Domain and Range of a Function

Graph of the Floor Function

The graph of ⌊x⌋ is a step function characterized by horizontal line segments and discontinuities at integers. Each interval [n, n + 1), where n ∈ Z, corresponds to a constant value n. Visually:

floor-2
Graph of Floor Function
  • This step-like behavior is a hallmark of the floor function, and it is crucial when understanding how the graph behaves.
    • For x ∈ [n, n + 1), the graph is a horizontal line at height n.
    • At each integer x = n, the function "jumps" from n − 1 to n, creating a discontinuity.

The graph is right-continuous (closed circles on the right endpoints of each step) but has open circles on the left endpoints. For instance, at x = 2, the point (2, 2) is included, while approaching 2 from the left, the value remains 1.

Key Properties of the Floor Function

1) Bounding Inequality:

⌊x⌋ ≤ x < ⌊x⌋ + 1.

This property encapsulates the definition: ⌊x⌋ is the largest integer not exceeding x.

2) Translation by an Integer:

For any integer k, ⌊x + k⌋ = ⌊x⌋ + k.

Adding an integer 'k' shifts the floor value by k.

3) Non-Decreasing Nature:

If x ≤ y, then ⌊x⌋ ≤ ⌊y⌋. The floor function never decreases as x increases.

4) Relationship with Ceiling Function:

⌊ −x ⌋ = −⌈ x ⌉

This property links the floor function to the ceiling function, where the floor of the negative of x is the negative of the ceiling of x.

5) Idempotency:

⌊⌊x⌋⌋ = ⌊x⌋

Applying the floor function twice has no effect since the result is already an integer.

6) Fractional Part:
The fractional part of x, denoted {x}, is defined as:

{x} = x − ⌊x⌋

This value always lies in the interval [0,1).

7) Sum of Floors:
For any real numbers x and y,

⌊x⌋ + ⌊y⌋ ≤ ⌊x + y⌋ ≤ ⌊x⌋ + ⌊y⌋ + 1.

This inequality highlights how the floor of a sum relates to the sum of the floor.

Floor vs Ceiling Function

Differences between floor and ceiling functions are as follows:

Floor

Ceiling

Rounds a number down to the nearest integer less than or equal to the number.

Rounds a number up to the nearest integer greater than or equal to the number.

The floor of 3.7 → 3

Ceiling of 3.7 → 4

Represented as floor(x)

Represented as ceil(x) or ⌈x⌉

Used when you need to round down.

Used when you need to round up.

Read More: Difference Between Floor and Ceil Function

Applications of the Floor Function

  1. Computer Science: Used in algorithms for integer division, data quantization, and indexing arrays.
  2. Number Theory: Essential in modular arithmetic and solving Diophantine equations.
  3. Calculus: Models discontinuities in piecewise functions and aids in analyzing limits.
  4. Signal Processing: Quantizes continuous signals into discrete levels.

Related Reads:

Solved Examples of Floor Function

Below are some solved examples of floor functions for better understanding.

Example 1: Find possible values of x if ⌊ x ⌋ = 4.

Solution:

We know that the floor function returns the largest integer less than or equal to the input number.

Thus, in this case, the value of x will be greater than or equal to 4 but less than 5.

4 ≤ x < 5

Example 2: Find possible values of x if ⌊ x ⌋ = −3.

Solution:

We know that the floor function returns the largest integer less than or equal to the input number, even for negative numbers.

Thus, in this case, the value of x will be greater than or equal to −3 but less than −2.

−3 ≤ x < − 2

Example 3: Calculate the floor function value for the values in the set [1.3, −0.51, 0.465, 1].

Solution:

We know that:

⌊x⌋ = max⁡(a ∈ Z ∣ a ≤ x)

Now, applying the floor function to the given values:

  • ⌊1.3⌋ = 1
  • ⌊−0.51⌋ = −1
  • ⌊0.465⌋ = 0
  • ⌊1⌋ = 1

Example 4: Calculate the value of ⌊5.1 + 1⌋.

Solution:

We know that ⌊x + a⌋ = ⌊x⌋ + a
Thus:
⌊5.1 + 1⌋ = ⌊5.1⌋ + 1 = 5 + 1 = 6

Example 5: Calculate the value of the floor function for the values in the set [−0.3, −0.91, 3.465, −9.4].

Solution:

We know that:

⌊x⌋ = max⁡(a ∈ Z ∣ a ≤ x)

Now, applying the floor function to the given values:

  • ⌊−0.3⌋ = −1
  • ⌊−0.91⌋ = −1
  • ⌊3.465⌋ = 3
  • ⌊−9.4⌋ = −10

Practice Problems on Floor Function

Question 1: Find the value of ⌊7.3⌋.

Question 2: If x = 4.98, what is ⌊x⌋?

Question 3: Evaluate ⌊10−7/2⌋.

Question 4: Calculate the floor function of the sum of 12.5 and 6.3.

Question 5: If y = 3.99, what is the value of ⌊2y⌋?

Comment

Explore