Mathwords logoReference LibraryMathwords

Floor Function

Floor Function
Greatest Integer Function

A step function of x which is the greatest integer less than or equal to x. The floor function is written a number of different ways: with special brackets Floor function notation: [x] with bold brackets or Floor function notation: ⌊x⌋ (x enclosed in left and right floor brackets), or by using either boldface brackets [x] or plain brackets [x].

Examples: Floor of 4.9 equals 4, written as ⌊4.9⌋ = 4 and Floor of -4.9 equals -5, written as ⌊-4.9⌋ = -5.

Graph of y = floor(x), showing horizontal steps with closed left endpoints and open right endpoints across all quadrants.

 

See also

Ceiling function (also known as least integer function)

Key Formula

x=max{nZnx}\lfloor x \rfloor = \max\{n \in \mathbb{Z} \mid n \leq x\}
Where:
  • xx = Any real number
  • nn = An integer less than or equal to x
  • x\lfloor x \rfloor = The greatest integer less than or equal to x (the floor of x)

Worked Example

Problem: Find the floor of each value: 3.7, −2.3, and 5.
Step 1: For 3.7, identify all integers less than or equal to 3.7. These are ..., 1, 2, 3. The greatest of these is 3.
3.7=3\lfloor 3.7 \rfloor = 3
Step 2: For −2.3, identify all integers less than or equal to −2.3. These are ..., −5, −4, −3. Note that −2 is greater than −2.3, so −2 does NOT qualify. The greatest qualifying integer is −3.
2.3=3\lfloor -2.3 \rfloor = -3
Step 3: For 5, the number is already an integer. The greatest integer less than or equal to 5 is 5 itself.
5=5\lfloor 5 \rfloor = 5
Answer: ⌊3.7⌋ = 3, ⌊−2.3⌋ = −3, and ⌊5⌋ = 5.

Another Example

Problem: A parking garage charges $4 per full hour. You park for 3 hours and 40 minutes (3.667 hours). How many full hours are you charged for?
Step 1: Convert the parking time to a decimal: 3 hours and 40 minutes = 3.667 hours.
Step 2: Apply the floor function to find the number of complete hours.
3.667=3\lfloor 3.667 \rfloor = 3
Step 3: Multiply by the rate per hour to find the charge.
3×4=123 \times 4 = 12
Answer: You are charged for 3 full hours, totaling $12.

Frequently Asked Questions

What is the floor of a negative number?
The floor of a negative number rounds it down (toward more negative values), not toward zero. For example, ⌊−1.5⌋ = −2, not −1. This is because −2 is the greatest integer that is still less than or equal to −1.5.
What is the difference between floor and truncation?
For positive numbers, floor and truncation give the same result—both drop the decimal part. For negative numbers, they differ: truncation removes the decimal and moves toward zero (trunc(−2.7) = −2), while floor rounds down away from zero (⌊−2.7⌋ = −3).

Floor Function vs. Ceiling Function

The floor function rounds down to the greatest integer less than or equal to x, while the ceiling function rounds up to the least integer greater than or equal to x. For example, ⌊3.2⌋ = 3 and ⌈3.2⌉ = 4. When x is already an integer, both functions return x itself. For negative values: ⌊−1.5⌋ = −2 (rounds down) and ⌈−1.5⌉ = −1 (rounds up).

Why It Matters

The floor function appears frequently in computer science, where integer division in most programming languages effectively applies a floor operation. It is essential in number theory for counting multiples, in combinatorics for distributing objects into groups, and in everyday applications like billing systems that charge per complete unit of time or quantity.

Common Mistakes

Mistake: Rounding negative numbers toward zero instead of downward.
Correction: Remember that 'rounding down' means moving toward negative infinity. For −4.1, the floor is −5, not −4, because −5 is the greatest integer that is still ≤ −4.1.
Mistake: Confusing the floor function with standard rounding.
Correction: Standard rounding rounds to the nearest integer (2.7 rounds to 3), but the floor function always rounds down (⌊2.7⌋ = 2). Floor never rounds up, regardless of the decimal part.

Related Terms