Skip to content
ihateDesmos

Graph of the floor function (greatest integer function)

Updated 20 October 2026 · Values computed by the ihateDesmos engine

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.

−4−224−220
Open in calculator
The graph of
y=floor(x)
for −5 ≤ x ≤ 5. Dots mark its y-intercept.

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.

Values of ⌊x⌋
xy = ⌊x⌋
−5/2−3
−1−1
−1/2−1
00
1/20
19/101
22

How to graph ⌊x⌋ by hand

  1. 1
    For each integer n, draw a horizontal segment at height n from x = n to x = n + 1.
  2. 2
    Put a filled dot at the left end of each segment and an open dot at the right end.
  3. 3
    Do not connect the steps with vertical lines.

Transformations

How the graph moves when you change the formula. The original is ⌊x⌋ in blue.

−4−224−220
  • 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?
The next integer down, which is further from zero: ⌊−2.3⌋ = −3.
What is the difference between floor and ceiling?
Floor rounds down, ⌊2.3⌋ = 2; ceiling rounds up, ⌈2.3⌉ = 3. They agree on integers.
Is the floor function continuous?
Only between integers. At every integer it jumps by 1.

Related graphs

Graph ⌊x⌋ your way

Change the window, add sliders for a, b, h and k, trace the curve with your keyboard, or overlay its derivative.

Open in the calculator