Floor Function Calculator

Enter a real number to find its floor ⌊x⌋, ceiling ⌈x⌉, nearest integer, and fractional part.

Quick Facts

Floor formula
⌊x⌋ = greatest integer ≤ x
Also written floor(x); it rounds down, toward negative infinity.
Ceiling relation
⌈x⌉ = −⌊−x⌋
Ceiling rounds up to the smallest integer ≥ x.
Negative numbers
⌊−3.2⌋ = −4
Floor moves toward negative infinity, not toward zero.

Your Results

Calculated
Floor ⌊x⌋
-
Greatest integer ≤ x
Ceiling ⌈x⌉
-
Smallest integer ≥ x
Nearest Integer
-
round(x) = ⌊x + 0.5⌋
Fractional Part
-
{x} = x − ⌊x⌋, always in [0, 1)

Ready

Enter a real number and press Calculate.

What the Floor Function computes

The floor function ⌊x⌋ (also written floor(x)) rounds any real number down to the nearest integer — it returns the greatest integer that is less than or equal to x. This calculator finds ⌊x⌋ along with three closely related values: the ceiling ⌈x⌉, the nearest integer, and the fractional part {x}.

How the floor function works

Formally, ⌊x⌋ is the largest integer n such that n ≤ x. For positive numbers this simply drops the decimal part: ⌊7.9⌋ = 7. For negative numbers it rounds away from zero, toward negative infinity, not toward zero: ⌊-3.2⌋ = -4, because -4 is the greatest integer still less than or equal to -3.2 (-3 is greater than -3.2, so it does not qualify). If x is already an integer, ⌊x⌋ = x exactly, e.g. ⌊5⌋ = 5.

Floor vs. ceiling vs. rounding

The ceiling function ⌈x⌉ is the mirror image of floor: it returns the smallest integer greater than or equal to x, and the two are related by ⌈x⌉ = -⌊-x⌋. Standard rounding to the nearest integer can itself be written using floor: round(x) = ⌊x + 0.5⌋. The fractional part {x} = x - ⌊x⌋ is always in the half-open interval [0, 1), even for negative x — for example {-3.2} = -3.2 - (-4) = 0.8.

Where the floor function shows up

  • Programming languages implement floor division (Python's // operator, or Math.floor() in JavaScript) using this exact rule.
  • Number theory and modular arithmetic define the modulo operation in terms of floor: a mod n = a - n·⌊a/n⌋.
  • Everyday rounding-down problems — how many full boxes fit, how many complete weeks have passed — are floor-function problems in disguise.

Frequently Asked Questions

What does the floor function ⌊x⌋ mean?
The floor function ⌊x⌋ returns the greatest integer that is less than or equal to x. For example, ⌊7.9⌋ = 7 and ⌊5⌋ = 5, since 5 is already an integer.
What is ⌊-3.5⌋? Why isn't it -3?
⌊-3.5⌋ = -4. The floor function rounds toward negative infinity, not toward zero, so for negative numbers it moves further from zero. -4 is the greatest integer that is still less than or equal to -3.5, because -3 is greater than -3.5 and does not qualify.
What is the difference between the floor and ceiling functions?
The floor function ⌊x⌋ rounds down to the nearest integer (⌊x⌋ ≤ x), while the ceiling function ⌈x⌉ rounds up to the nearest integer (⌈x⌉ ≥ x). The two are related by the identity ⌈x⌉ = -⌊-x⌋.
How does rounding to the nearest integer relate to the floor function?
Standard rounding to the nearest integer can be written using floor as round(x) = ⌊x + 0.5⌋. This adds 0.5 before flooring, which rounds ties like 2.5 up to the next integer.