How this instrument works
The floor of a real number is the greatest integer that does not exceed it, written ⌊x⌋. Picture sliding down the number line from x until the first whole number appears underfoot, then stopping — the motion only ever goes downward, no matter how close the fractional part sits to the next integer above. ⌊3.7⌋ is 3, and so is ⌊3.001⌋, because both values sit in the same stretch running from 3 up to but not including 4; an exact integer like 4 is already its own floor and needs no adjustment at all.
Carl Friedrich Gauss introduced the square-bracket notation [x] for this greatest-integer value in 1808, using it inside his third proof of the law of quadratic reciprocity; it stood as the standard notation for well over a century until Kenneth Iverson split the symbol into the separate floor ⌊x⌋ and ceiling ⌈x⌉ brackets in 1962. The function earns its keep in number theory well beyond notation: Legendre's formula finds how many times a prime p divides n! by summing ⌊n/p⌋ + ⌊n/p²⌋ + ⌊n/p³⌋ and so on until the terms reach zero, turning a monstrous factorial into a handful of small divisions.
Negative inputs are where floor most often trips people up, especially in code: floor always moves toward negative infinity, so ⌊−3.2⌋ is −4, one whole number further from zero, not −3. That differs from plain truncation — chopping off the decimal part, as many languages' int() or trunc() casts do — which would leave −3.2 at −3 instead, a full unit off. The two operations agree for every positive input and for exact integers, and disagree by exactly one for every negative non-integer, a mismatch that has produced real off-by-one bugs wherever a truncating cast stood in for an actual floor.
- Enter any real number — positive, negative, a whole number, or a decimal — into the x field.
- Read ⌊x⌋: it reports the greatest integer that does not exceed your entry, rounding toward negative infinity.
- Try a negative decimal such as −3.2 and confirm ⌊x⌋ lands on −4, one whole number further from zero, not −3.
- Enter a whole number such as 5 and check that ⌊x⌋ returns 5 unchanged, since integers are fixed points of the floor function.
Worked example — flooring 3.7
Set x to 3.7 and read ⌊x⌋: the sheet returns 3. The value 3.7 sits inside the span running from 3 up to but not including 4, and the greatest integer inside or at the bottom edge of that span is 3 — so the answer settles on the lower whole number instead of 4, the one ordinary rounding would pick since 3.7 sits closer to 4 than to 3.
The defining inequality checks the same answer without re-deriving it: ⌊x⌋ ≤ x < ⌊x⌋ + 1 becomes 3 ≤ 3.7 < 4, a true statement, while 4 ≤ 3.7 < 5 is false, ruling out 4 as a candidate. Set x to −3.2 on the same sheet and ⌊x⌋ returns −4, not −3, because −4 ≤ −3.2 < −3 holds while −3 ≤ −3.2 < −2 does not — floor moves down the number line, and for a negative input that means further from zero, not toward it.
Questions
What does the floor function do?
It returns the greatest integer that does not exceed the number entered, always rounding down toward negative infinity rather than toward whichever whole number is nearest. 3.7 becomes 3, 3.001 becomes 3, and only an input already whole, such as 5, comes back unchanged, since 5 is already the greatest integer that does not exceed itself.
How is the floor function different from ordinary rounding?
Ordinary rounding compares distances and picks whichever whole number is nearer, so 3.7 would round up to 4. The floor function ignores distance entirely and asks only which integer sits at or below the input, so 3.001, 3.5, and 3.99 all resolve to 3 no matter how close any of them sit to 4.
Why does −3.2 floor to −4 instead of −3?
Floor always moves toward negative infinity, and for a negative number that direction points further from zero, not closer to it. −4 is less than −3.2 and is the greatest integer that still clears the ≤ test, while −3 is greater than −3.2 and fails it. Truncating code gets this wrong, since chopping the decimal off −3.2 gives −3, a different answer from the true floor.
How does the floor function relate to the ceiling function?
The two are linked by ⌊x⌋ = −⌈−x⌉ — negate the input, take the ceiling, negate the result, and the floor falls out. Checking it against 3.7: ⌈−3.7⌉ is −3, and −(−3) is 3, the same value ⌊3.7⌋ already gives directly. The pair never disagrees by more than one step, and they meet exactly when the input is already a whole number.
What happens when the input is already a whole number?
It passes through unchanged: 5 is already the greatest integer that does not exceed 5, so ⌊5⌋ = 5 with nothing to round away. Whole numbers are the fixed points of the floor function — the only inputs where the staircase graph actually touches the line y = x instead of sitting strictly below it.
Where does the ⌊x⌋ bracket notation come from?
Carl Friedrich Gauss introduced the square-bracket form [x] for this value in 1808, inside his third proof of quadratic reciprocity, and it served as the standard notation for well over a century. Kenneth Iverson split it into the separate floor ⌊x⌋ and ceiling ⌈x⌉ brackets in 1962, so the rounding direction no longer had to be inferred from context.