Example 1
- x = 3.7
3
What is ⌊3.7⌋? 3.
Enter a real number x. Floor ⌊x⌋ is the greatest integer n ≤ x. ⌊3.7⌋ = 3. ⌊−1.2⌋ = −2 (not −1). ⌊5⌋ = 5.
Enter x, for example 3.7 or −1.2.
The calculator returns the integer part toward −∞. For negative non-integers the result differs from truncation toward zero. A whole x stays itself.
The floor function, written ⌊x⌋ (Iverson’s notation popularized by Donald Knuth), is the greatest integer that does not exceed x. Formally: ⌊x⌋ = n ∈ ℤ if and only if n ≤ x < n+1. For x = 3.7 we have 3 ≤ 3.7 < 4, so ⌊3.7⌋ = 3. When x is already an integer the interval is [x, x+1), so ⌊5⌋ = 5.
For negatives, floor does not clip toward zero. ⌊−1.2⌋ = −2, because −2 ≤ −1.2 < −1; −1 is already larger than −1.2. Truncation (trunc) would give −1, and ceil ⌈−1.2⌉ = −1. That gap is the most common classroom and coding trap.
The floor-based fractional part is {x} = x − ⌊x⌋ and always lies in [0, 1). For 3.7 it is 0.7; for −1.2 it is 0.8 (not −0.2). The fractional-part calculator on the neighbouring page uses the same formula; here the result is the integer n alone.
The calculator uses the number x you enter in the “Number x” field. The calculator computes ⌊x⌋ — matching the mathematical floor for finite numbers. A comma and a period are equivalent.
The mathematical model is the classical floor (integer-part) function from real analysis and from Concrete Mathematics (Graham, Knuth, Patashnik). NIST DLMF §1.4 lists floor among elementary functions. Do not confuse it with rounding to n decimal places, which keeps a fraction.
Reference examples: ⌊3.7⌋ = 3, ⌊−1.2⌋ = −2, ⌊5⌋ = 5, ⌊0.9⌋ = 0, ⌊−0.1⌋ = −1, ⌊−3⌋ = −3. The result panel also shows ceil, trunc, {x}, and the interval [n, n+1), and the diagram places x on the number line against the floor step.
⌊x⌋ = n, where n ∈ ℤ and n ≤ x < n+1.
Equivalently: ⌊x⌋ = max{ k ∈ ℤ : k ≤ x }. Symbol x is the entered number (the “Number x” field). Symbol n is the integer result. Fractional part: {x} = x − ⌊x⌋ ∈ [0, 1).
Computation: ⌊x⌋. Mathematical model: floor (integer-part) function — NIST DLMF §1.4; Concrete Mathematics (Graham, Knuth, Patashnik).
The integer part in the floor sense, written ⌊x⌋, is the greatest integer not exceeding x. Formally: ⌊x⌋ = max{ n ∈ ℤ : n ≤ x }. For x ≥ 0 this matches the school habit of cutting off the fractional digits downward; for x < 0, floor moves toward −∞, not toward zero. Example: ⌊3.7⌋ = 3, but ⌊−1.2⌋ = −2, not −1.
The definition of floor (and the dual ceiling ⌈x⌉) is standard in NIST DLMF §1.4 (Floor and Ceiling), Graham–Knuth–Patashnik Concrete Mathematics, and MathWorld (Floor Function). The calculator computes floor — the same function the browser provides.
In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.
The notation ⌊x⌋ was popularized by Kenneth E. Iverson (APL) and then by Concrete Mathematics (Knuth et al.). Older texts spoke of “entier” (Gauss) — the greatest integer ≤ x, i.e. floor. In computing, distinguishing floor, trunc (toward zero), and ceil is critical for array indexing and for negative integer division.
Conceptually floor is not rounding to the nearest integer. It is also not the fractional part. The analytic fractional part is {x} = x − ⌊x⌋ ∈ [0, 1); a separate calculator on this site computes {x}.
In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.
Domain: ℝ (in practice finite floating-point numbers). Codomain: ℤ. The function is nondecreasing, right-continuous, with jumps at the integers. ⌊x⌋ = x ⇔ x ∈ ℤ.
Identities: ⌊x⌋ ≤ x < ⌊x⌋ + 1; ⌊x + n⌋ = ⌊x⌋ + n for n ∈ ℤ; ⌊−x⌋ = −⌈x⌉. For positive a, b, formulas for ⌊a/b⌋ in integer arithmetic depend on signs — hence programming languages disagree on negative division.
Link to the fractional part: x = ⌊x⌋ + {x}, 0 ≤ {x} < 1. Ceiling: ⌈x⌉ = −⌊−x⌋.
In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.
Step 1. The set { n ∈ ℤ : n ≤ x } is nonempty and bounded above by x, so a maximum exists in ℤ — denote it ⌊x⌋.
Step 2. By maximality: ⌊x⌋ ≤ x and ⌊x⌋ + 1 > x, hence ⌊x⌋ ≤ x < ⌊x⌋ + 1.
Step 3 (integer shift). If n ∈ ℤ, then m ≤ x ⇔ m + n ≤ x + n, so the max shifts by n: ⌊x + n⌋ = ⌊x⌋ + n.
Step 4 (negatives). For x = −1.2 the integers ≤ −1.2 are …, −3, −2; the maximum is −2. Truncation toward zero would give −1 — a different function. Concrete Mathematics and Knuth stress this distinction.
In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.
Examples: ⌊3.7⌋ = 3; ⌊5⌋ = 5; ⌊0.9⌋ = 0; ⌊−0.1⌋ = −1; ⌊−1.2⌋ = −2; ⌊−3⌋ = −3. On the integers, floor is the identity.
Limits: as x → n⁻ for an integer n, ⌊x⌋ = n − 1; as x → n⁺, ⌊x⌋ = n. The step graph jumps at every integer (right-continuous).
In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.
floor operates on floating-point numbers. For |x| > 2⁵³ not every integer is exactly representable — floor then acts on an already rounded machine value. Comma and period are equivalent.
The panel may show ceil, trunc, and {x}. The calculator does not compute modulo or integer division with remainder — only ⌊x⌋.
In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.
Related: fractional part {x} = x − ⌊x⌋, decimal-to-fraction, maximum of two numbers. Round-to-nearest is a separate model.
Authorities: NIST DLMF §1.4; Graham, Knuth, Patashnik — Concrete Mathematics; MathWorld — Floor Function; Knuth, TAOCP. Educational tool.
In classroom practice it helps to separate the mathematical formula from floating-point limits: this calculator reports the browser’s floating-point computation (about 15–16 significant digits), not a symbolic identity on paper. When inputs are extreme, check the domain first, then the floating-point range.
Floor returns the greatest integer ≤ x. ⌊3.7⌋ = 3. ⌊−1.2⌋ = −2. Trunc at −1.2 would give −1.
3
What is ⌊3.7⌋? 3.
−2
What is ⌊−1.2⌋? −2 (not −1).
5
What is ⌊5⌋? 5.
0
What is ⌊0.9⌋? 0.
−1
What is ⌊−0.1⌋? −1 (trunc = 0).
−3
What is ⌊−3⌋? −3.
⌊x⌋ is the greatest integer n such that n ≤ x. Equivalently: n ≤ x < n+1. The calculator returns that integer; the fractional part {x} = x − ⌊x⌋ lies in [0, 1).
The result is 3. Three satisfies 3 ≤ 3.7 < 4, and four does not. That is the first worked example on this page.
The result is −2, not −1. Floor steps toward −∞: −2 ≤ −1.2 < −1, while −1 is already larger than −1.2. Truncation toward zero would give −1.
Ceil ⌈x⌉ is the least integer ≥ x. Trunc drops the fraction toward zero. “Int” in some languages aliases trunc or floor — here it is always floor. For −1.2: floor = −2, trunc = −1, ceil = −1.
{x} = x − ⌊x⌋. For x = 3.7 it is 0.7; for x = −1.2 it is 0.8. Always 0 ≤ {x} < 1. The fractional-part page uses the same formula.
⌊5⌋ = 5 (a whole x stays itself). ⌊0.9⌋ = 0. ⌊−0.1⌋ = −1, because −1 ≤ −0.1 < 0.
The browser calls ⌊x⌋ on a floating-point number. For finite x the result matches mathematical floor; very large |x| may already lose fractional bits in the floating-point representation itself.
Yes. 3.7 and 3,7 both give 3. The field accepts US and European decimal writing.
No. The result depends only on the entered x. The currency and unit settings in the page header do not affect this result.
Iverson/Knuth bracket notation is standard in analysis and in Concrete Mathematics (Graham, Knuth, Patashnik). NIST DLMF §1.4 lists floor among elementary functions. The computation here is floor.
Take the greatest integer n such that n ≤ x. For 3.7 that is 3; for −1.2 that is −2. Floor always moves toward −∞, not toward zero.
Floor, greatest integer, or entier is ⌊x⌋ = max{n ∈ ℤ : n ≤ x}. The ⌊x⌋ notation is standard; code often uses floor(x). Do not confuse it with truncation toward zero.
For positive numbers the results match. For negatives, floor goes to −∞ (⌊−2.1⌋ = −3), while “down toward zero” would give −2. This calculator always computes floor.
3, because 3 ≤ π ≈ 3.14159 < 4. Enter about 3.14159 to see the same result.
Only for x ≥ 0. When x < 0 they differ: ⌊−1.2⌋ = −2, while trunc(−1.2) = −1. The panel shows trunc beside floor so you can see the difference.
The definition, ⌊x⌋ notation, and ceil comparison come from established sources.
Page Updated November 2, 2026.