Audited 05 Aug 2026·Last updated 28 Oct 2026·3 citations·Tier 2·0 uses

Floor Function Calculator

Find the floor of any number: the greatest integer less than or equal to it, so 3.2 gives 3 and −3.2 gives −4. Works for decimals and negatives.

Floor Function Calculator

Floor
3
The greatest integer less than or equal to the number entered — for a negative non-integer, one below the digits in front of the decimal point.

Background.

Rounding down sounds like the simplest operation in arithmetic until a negative number turns up. Ask for the whole number below 3.2 and everyone answers 3. Ask for the whole number below −3.2 and many people, and several programming languages' integer conversions, answer −3 — which is above −3.2, not below it. The floor function settles the matter: it is the greatest integer less than or equal to the number, so the floor of −3.2 is −4.

Written ⌊x⌋, a notation Kenneth Iverson introduced in 1962 together with the ceiling ⌈x⌉, the floor turns up wherever only complete units count. Age in years is the floor of the time since birth. The full hours in 135 minutes number ⌊135/60⌋ = 2. The multiples of 7 up to 100 number ⌊100/7⌋ = 14. Number theory leans on it as well: the zeros at the end of 100 factorial number ⌊100/5⌋ + ⌊100/25⌋ = 24, one for every factor of 5 that pairs with a factor of 2.

The floor also splits any real number into two pieces. Subtract it from the original and what is left is the fractional part, always at least 0 and less than 1 — 0.2 for 3.2, but 0.8 for −3.2, because −3.2 = −4 + 0.8. That asymmetry is exactly what makes floor consistent: the integer piece always sits to the left on the number line and the leftover is always positive.

Enter one real number between minus and plus one billion and the page returns its floor as an integer.

What is floor function calculator?

The floor of a real number x, written ⌊x⌋ or floor(x), is the largest integer n with n ≤ x. Equivalently, it is the one integer satisfying ⌊x⌋ ≤ x < ⌊x⌋ + 1. For a positive number it drops whatever follows the decimal point; for a negative non-integer it moves one step further from zero; for an integer it returns the number unchanged. Plotted, it is a staircase: flat across each interval from n up to just below n + 1, then jumping up by one at the next integer.

How to use this calculator.

  1. Type the number in the Real value field. Decimals and negative numbers are fine anywhere from −1,000,000,000 to 1,000,000,000.
  2. The field takes a single number, not an expression, so work out a fraction first: for 17/4, enter 4.25.
  3. If a division comes out to an exact whole number, enter that whole number rather than a rounded decimal — 21/7 is 3, and a typed 2.9999 would floor to 2.
  4. Read the floor. For a negative input that is not a whole number, the answer is one below the digits in front of the decimal point; that is correct, not an error.
  5. For the ceiling of a number, enter its negative and flip the sign of the answer: the floor of −3.2 is −4, so the ceiling of 3.2 is 4.

The formula.

floor(x) is the greatest integer less than or equal to x

⌊x⌋ = max{ n ∈ ℤ : n ≤ x }, the greatest integer not exceeding x. The defining inequality ⌊x⌋ ≤ x < ⌊x⌋ + 1 is the most useful way to check an answer: the floor must sit at or below x, and the next integer up must sit above it. Several identities follow. Adding a whole number passes straight through, so ⌊x + n⌋ = ⌊x⌋ + n for any integer n. The ceiling is the mirror image, ⌈x⌉ = −⌊−x⌋. The fractional part is x − ⌊x⌋, which always lies in [0, 1). For positive numbers floor and truncation agree; for negative non-integers floor is truncation minus one. The answer changes only when x crosses an integer — every value from 3 up to, but not including, 4 has a floor of 3.

A worked example.

Example

Start with 3.2. The integers at or below it are 3, 2, 1, 0, −1 and so on without end, and the greatest of them is 3, so the floor is 3. The fractional part is 3.2 − 3 = 0.2, and the defining check 3 ≤ 3.2 < 4 holds. Now flip the sign. The integers at or below −3.2 are −4, −5, −6 and onward; −3 is not among them, because −3 is greater than −3.2. So the floor of −3.2 is −4, and the fractional part is −3.2 − (−4) = 0.8. Chopping off the decimals instead would have given −3, which is why a truncating function and a floor function disagree for every negative number that is not already whole.

value3.2

Frequently asked questions.

Why is the floor of −3.2 equal to −4 and not −3?
Because the floor must be less than or equal to the number, and −3 is greater than −3.2. On a number line, −3.2 lies between −4 and −3; the floor is always the integer on the left. Dropping the decimal digits gives −3, but that is truncation toward zero, a different operation.
How is the floor different from rounding and truncating?
For 3.7, rounding gives 4 while floor and truncation both give 3. For −3.7, rounding and floor both give −4, but truncation gives −3. Floor always moves left on the number line, truncation always moves toward zero, and rounding moves to whichever integer is nearer.
Which spreadsheet and programming functions compute the floor?
In Excel and Google Sheets, INT rounds down to the nearest integer, so INT(−3.2) returns −4, while TRUNC drops the decimals. JavaScript's Math.floor and Python's math.floor return the floor, and Python's // operator performs floor division. Integer division in C and Java truncates toward zero instead.
Where does the floor function come up in everyday counting?
Any time only complete groups count. Fifty eggs fill ⌊50/12⌋ = 4 full boxes of a dozen. A person's age is the floor of the years since birth. Paging through 95 results ten at a time gives ⌊95/10⌋ = 9 full pages, with the remainder on a partial tenth page.
Is the floor the same as the integer part of a number?
For positive numbers, yes. For negatives it depends on who is writing: some texts define the integer part by truncation, so the integer part of −3.2 is −3, while older number-theory books use the bracket [x] to mean the floor, −4. When precision matters, ⌊x⌋ removes the ambiguity.

How this page was produced

Published by
Quanta Calculator
Primary sources
3 cited below
Method
floor(x) is the greatest integer less than or equal to x
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon