In short
The greatest integer function [x] (also written \lfloor x \rfloor) returns the largest integer that is less than or equal to x. For positive numbers this is "round down": [3.7] = 3. For negative numbers the floor is below the number on the number line: [-2.3] = -3. The graph is a staircase of horizontal segments, each closed on the left and open on the right. This function appears throughout number theory, combinatorics, and competitive-exam problems.
Picture the fare chart at an auto-rickshaw stand in Pune. The meter shows ₹23 per kilometre, but the driver rounds the distance down to the nearest whole kilometre before multiplying. If your ride is 4.8 km, the driver charges you for 4 km, not 5. If your ride is exactly 5.0 km, the driver charges for 5 km. That act of rounding down — always toward the smaller integer, never up — is precisely what the greatest integer function does.
Mathematicians call it the floor function and write it as \lfloor x \rfloor. In Indian textbooks for class 11, the standard notation is [x] and the standard name is the greatest integer function (GIF). Both notations mean the same thing: the largest integer that does not exceed x.
The definition
Greatest Integer Function
For any real number x, the greatest integer function [x] is defined as the largest integer n such that n \le x. Equivalently:
Domain: \mathbb{R}. Range: \mathbb{Z} (the set of all integers).
Here are some values to build your intuition:
| x | [x] | Reasoning |
|---|---|---|
| 3.7 | 3 | The largest integer \le 3.7 is 3 |
| 3.0 | 3 | The largest integer \le 3.0 is 3 itself |
| 0.5 | 0 | The largest integer \le 0.5 is 0 |
| -0.5 | -1 | The largest integer \le -0.5 is -1, not 0 |
| -2.3 | -3 | The largest integer \le -2.3 is -3, not -2 |
| -4.0 | -4 | An integer is its own floor |
The negative cases are where most errors happen. The floor of -2.3 is -3, not -2, because -2 > -2.3 — the integer -2 is above the number, not below it. The floor must be at or below the number on the number line.
The fractional part
A companion to [x] is the fractional part \{x\} = x - [x]. It measures how far x sits above its floor.
- \{3.7\} = 3.7 - 3 = 0.7
- \{-2.3\} = -2.3 - (-3) = 0.7
- \{5.0\} = 5.0 - 5 = 0
The fractional part always satisfies 0 \le \{x\} < 1. When x is an integer, \{x\} = 0. When x is not an integer, \{x\} is a positive number less than 1.
The identity x = [x] + \{x\} holds for every real number. This decomposition — splitting a real number into its integer part and its fractional part — is useful in number theory, modular arithmetic, and many competition problems.
The staircase graph
The graph of y = [x] is a staircase. On each interval [n, n+1), the function takes the constant value n. At x = n, the function jumps to the next step.
Key features of the staircase:
- Solid dot on the left, hollow dot on the right. Each step covers the interval [n, n+1). At x = n, the function equals n (solid dot). Just before x = n+1, the function is still n (hollow dot). At x = n+1, the function jumps to n+1.
- Jump discontinuities. At every integer, the function jumps by 1. Between integers, it is constant (and therefore continuous).
- The stairs go up to the right and down to the left, one unit at a time, forever in both directions.
Properties of [x]
Here are the algebraic properties you will use most often.
Property 1. [x] \le x < [x] + 1 for all x \in \mathbb{R}.
This is a restatement of the definition. The floor [x] is at most x, and the next integer [x] + 1 is strictly greater than x.
Property 2. [x] = x if and only if x is an integer.
If x is already an integer, its floor is itself. If x is not an integer, the floor is strictly less.
Property 3. [x + n] = [x] + n for any integer n.
Adding an integer to x shifts the staircase by n steps. The fractional part does not change: \{x + n\} = \{x\}.
Property 4. [x] + [y] \le [x + y] \le [x] + [y] + 1 for all x, y.
The floor of a sum is not simply the sum of the floors. It could be one more. For example, [1.7] + [1.6] = 1 + 1 = 2, but [1.7 + 1.6] = [3.3] = 3 = 2 + 1.
Property 5. [-x] = -[x] when x is an integer, and [-x] = -[x] - 1 when x is not an integer.
This is why the negatives are tricky. For non-integer x, the floor of -x is one less than the negative of [x].
The graph of y = \{x\}
Since \{x\} = x - [x], the fractional part graph is a sawtooth wave. On each interval [n, n+1), \{x\} = x - n — a line segment rising from 0 to just below 1, then dropping back to 0 at the next integer.
The fractional part function is periodic with period 1: \{x + 1\} = \{x\} for all x. Its range is [0, 1).
Applications
The greatest integer function appears in several practical and theoretical settings.
Counting multiples. The number of multiples of d in the set \{1, 2, 3, \ldots, n\} is \left[\frac{n}{d}\right]. For instance, the number of multiples of 7 up to 100 is \left[\frac{100}{7}\right] = [14.28\ldots] = 14.
Postage and pricing. When a post office charges ₹5 for the first 10 grams and ₹2 for each additional 10-gram slab, the charge for a letter weighing w grams is 5 + 2 \cdot \left[\frac{w - 1}{10}\right] (for w > 10). The floor function captures the "slab" structure of the pricing.
The staircase in competitive problems. Many JEE and olympiad problems ask you to evaluate sums, solve equations, or sketch graphs involving [x]. The key technique is to break the real line into intervals [n, n+1) and work on each interval separately, since [x] = n is constant on that interval.
Two worked examples
Example 1: Sketch $y = x - [x]$ and find its domain and range
Step 1. Recognise that x - [x] = \{x\}, the fractional part function.
Why: by definition, \{x\} = x - [x]. Recognising this saves you from graphing from scratch — you already know the shape.
Step 2. On each interval [n, n+1), the value is x - n. At x = n, this is 0. Just before x = n+1, this approaches 1. So each piece is a line segment from (n, 0) to just before (n+1, 1).
Why: since [x] = n on [n, n+1), the expression x - [x] simplifies to x - n, a linear function of x with slope 1.
Step 3. At each integer, the function resets to 0. The graph is a sawtooth wave.
Why: at x = n+1, the floor jumps to n+1, so x - [x] = (n+1) - (n+1) = 0. The function drops from just below 1 back to 0.
Step 4. State domain and range.
Domain: \mathbb{R} (every real number has a fractional part). Range: [0, 1) (the fractional part is always at least 0 and strictly less than 1).
Result: Domain = \mathbb{R}. Range = [0, 1). The graph is the sawtooth wave.
The sawtooth pattern repeats with period 1. At every integer the function resets to 0, confirming that the range is [0, 1) — the value 1 is never achieved.
Example 2: Solve $[x]^2 - 5[x] + 6 = 0$
Step 1. Let n = [x]. Since [x] is always an integer, n \in \mathbb{Z}. The equation becomes n^2 - 5n + 6 = 0.
Why: substituting n = [x] converts the problem into a standard quadratic in integers, which is much easier to handle.
Step 2. Factor the quadratic: n^2 - 5n + 6 = (n - 2)(n - 3) = 0, so n = 2 or n = 3.
Why: the product of two factors is zero exactly when at least one factor is zero.
Step 3. Convert back to x. If [x] = 2, then 2 \le x < 3. If [x] = 3, then 3 \le x < 4.
Why: the definition of [x] = n means n \le x < n + 1. Each integer solution for n gives an entire interval of x-values.
Step 4. Combine the intervals: x \in [2, 3) \cup [3, 4) = [2, 4).
Why: the two intervals share the endpoint x = 3, which is included in the second interval. Together they cover everything from 2 to just below 4.
Result: x \in [2, 4).
The key move is the substitution n = [x]: it converts a floor-function equation into a polynomial in integers, which you can factor. After solving for n, you convert each integer back into an interval of real numbers.
Common confusions
-
"The floor of -2.3 is -2." The floor is the largest integer less than or equal to x. Since -2 > -2.3, the integer -2 is too large. The correct floor is -3.
-
"[x + y] = [x] + [y]." Not always. The sum [1.6] + [1.7] = 1 + 1 = 2, but [1.6 + 1.7] = [3.3] = 3. The correct inequality is [x] + [y] \le [x+y] \le [x] + [y] + 1.
-
"The fractional part \{x\} can equal 1." The fractional part satisfies 0 \le \{x\} < 1 — strictly less than 1. If \{x\} were 1, that would mean x = [x] + 1, making [x] + 1 an integer \le x, contradicting the definition of [x] as the greatest such integer.
-
"The greatest integer function is the same as rounding." Rounding goes to the nearest integer (up or down). The floor always goes down — to the smaller integer. For positive numbers the distinction barely matters when the fractional part is small, but for negative numbers and for fractional parts above 0.5, rounding and flooring give different results. [2.8] = 2 (floor), but rounding 2.8 gives 3.
-
"The staircase graph is a function." It is. Despite the jumps, every vertical line crosses the staircase at exactly one point (because at each integer, the solid dot belongs to the step starting there, and the hollow dot from the previous step is not on the curve). The vertical line test is satisfied.
Going deeper
The properties and graph above are enough for class 11. The material below explores a formula useful in competition mathematics and a connection to number theory.
Hermite's identity
For any real x and positive integer n:
This says that the floor of nx can be computed by summing n floors of x shifted by \frac{k}{n} for k = 0, 1, \ldots, n-1.
For n = 2: [2x] = [x] + \left[x + \frac{1}{2}\right].
Check with x = 1.3: [2.6] = 2. And [1.3] + [1.8] = 1 + 1 = 2. It works.
Check with x = 1.7: [3.4] = 3. And [1.7] + [2.2] = 1 + 2 = 3. Correct again.
Prime factorisation and Legendre's formula
The highest power of a prime p that divides n! is given by:
The sum is finite because eventually p^k > n and the floor becomes 0.
For n = 100, p = 5: \left[\frac{100}{5}\right] + \left[\frac{100}{25}\right] + \left[\frac{100}{125}\right] = 20 + 4 + 0 = 24. So 100! has exactly 24 factors of 5 in its prime factorisation — and therefore exactly 24 trailing zeros (since there are more than enough factors of 2).
This is a classic application of the floor function to number theory, and it appears regularly in olympiad problems and JEE Advanced.
Where this leads next
The greatest integer function is the first in a family of "special" functions that behave differently from the smooth, continuous functions you met in graphs of basic functions. Here is what connects to it.
- Special Functions — Part 2 — the signum function, the smallest integer function (ceiling), and piecewise-defined functions.
- Graphs of Basic Functions — the smooth functions that contrast with the staircase graph studied here.
- Functions — Definition and Notation — the formal framework that makes [x] a valid function despite its jumps.
- Domain and Range — the techniques for finding domain and range, applied here to [x] and \{x\}.
- Ways to Define Functions — piecewise definitions, which are exactly how [x] is specified on each interval.