What Is the Floor Function?
The floor function, written \(\lfloor x \rfloor\), takes any real number and returns the greatest integer that is less than or equal to it. In other words, it rounds down toward negative infinity. For positive numbers this simply drops the fractional part, but for negative numbers it pushes further away from zero — a detail that trips up many people.
How to Use This Calculator
Type any number — whole, decimal, positive, or negative — into the input box and the calculator returns \(\lfloor x \rfloor\) immediately. There are no other settings: the floor is a single, well-defined integer for every real input.
The Formula Explained
Formally,
$$\lfloor x \rfloor = \max\{\, n \in \mathbb{Z} \mid n \leq x \,\}$$You look at every integer not exceeding x and pick the largest one. For \(x = 3.7\) the integers \(\leq 3.7\) are \(\ldots, 1, 2, 3\), so the largest is 3. For \(x = -2.3\) the integers \(\leq -2.3\) are \(\ldots, -4, -3\), so the answer is \(-3\), not \(-2\).
Worked Example
Suppose \(x = 7.9\). The integers less than or equal to 7.9 include 7 but not 8, so
$$\lfloor 7.9 \rfloor = 7$$Now take \(x = -0.5\): the largest integer not exceeding \(-0.5\) is \(-1\), so
$$\lfloor -0.5 \rfloor = -1$$FAQ
How is floor different from rounding? Standard rounding goes to the nearest integer, so 3.7 rounds to 4, but \(\lfloor 3.7 \rfloor = 3\). Floor always goes down.
What is the floor of a whole number? The floor of any integer is itself: \(\lfloor 5 \rfloor = 5\) and \(\lfloor -5 \rfloor = -5\).
How does floor handle negatives? It rounds toward negative infinity, so \(\lfloor -1.2 \rfloor = -2\), not \(-1\).