Graph of the floor function (greatest integer function)
The floor function rounds down to the nearest integer: ⌊2.7⌋ = 2 and ⌊−2.3⌋ = −3. Its graph is a staircase of horizontal steps, each one unit long, jumping up by one at every integer.
Key features
- Domain
- All real numbers
- Range
- The integers
- Jumps
- Up by 1 at every integer
- Each step
- Closed dot on the left, open dot on the right: [n, n + 1) maps to n
- Continuity
- Continuous except at the integers
- Slope
- 0 on every step
- y-intercept
- None
- Derivative
- 0 between integers; undefined at the integers, where the graph jumps
- Antiderivative
- No single formula: the area under the steps grows piecewise linearly
Derivative and antiderivative from the calculator’s algebra system. Domain, range and asymptotes are stated for real x.
What the graph of ⌊x⌋ looks like
On each interval n ≤ x < n + 1 the function is the constant n, so the graph is a horizontal segment that includes its left end (a filled dot) and excludes its right end (an open dot).
Because the function jumps at every integer, it is discontinuous there. The calculator draws each step separately rather than joining them with vertical lines, which are not part of the graph.
For negative numbers, rounding down means moving away from zero: ⌊−0.5⌋ = −1. This is the most common source of mistakes with the floor function.
Points of interest
Found numerically to about twelve digits in the window −5 ≤ x ≤ 5, then shown in exact form where one exists.
- x-intercepts (roots)
- x = 0
- Local maxima
- (−2.997, −3), (3.003, 3)
- Local minima
- (−2.0042, −3), (−1.0042, −2), (−0.0042, −1), (1.9958, 1), (2.9917, 2), (3.9917, 3)
- Inflection points
- (−99/20, −5), (−4.9475, −5), (−4.945, −5), (−4.9425, −5), (−4.94, −5), (−79/16, −5) … (3790 in view)
The roots are the whole interval 0 ≤ x < 1, where ⌊x⌋ = 0, rather than isolated points, so the root finder reports none.
Table of values
A few points to plot, with exact values where they are simple.
| x | y = ⌊x⌋ |
|---|---|
| −5/2 | −3 |
| −1 | −1 |
| −1/2 | −1 |
| 0 | 0 |
| 1/2 | 0 |
| 19/10 | 1 |
| 2 | 2 |
How to graph ⌊x⌋ by hand
- 1For each integer n, draw a horizontal segment at height n from x = n to x = n + 1.
- 2Put a filled dot at the left end of each segment and an open dot at the right end.
- 3Do not connect the steps with vertical lines.
Transformations
How the graph moves when you change the formula. The original is ⌊x⌋ in blue.
y = ceil(x)The ceiling function: rounds up, so each step is open on the left.y = x - floor(x)The fractional part: a sawtooth wave rising from 0 to 1.y = floor(x/2)Steps twice as wide.
Frequently asked questions
What is the floor of a negative number?
What is the difference between floor and ceiling?
Is the floor function continuous?
Related graphs
A V with its vertex at the origin, slopes ±1.
A straight line: slope m, y-intercept b.
Oscillations that grow, trapped between y = ±x.
A decaying wave with limit 1 at the origin.
The S-curve from 0 to 1, midpoint (0, ½).
The basic parabola: vertex (0, 0), opens upward.
Change the window, add sliders for a, b, h and k, trace the curve with your keyboard, or overlay its derivative.