Mathematics calculator

Floor Function Calculator

Find the greatest integer less than or equal to a real number and compare it with the ceiling and fractional part.

Calculator inputs

Enter your values

Greatest integer
Calculated output

Result summary

Your result will appear here

Complete the required fields and select the calculate button.

A number line showing a decimal value and the lower integer selected by the floor function
For a negative decimal, floor moves left toward negative infinity rather than toward zero.

What Is the Floor Function?

The floor of a number is the greatest integer that is less than or equal to it. For 6.9, that integer is 6. For −6.9, it is −7. The negative example is often the surprising one: floor always moves towards the lower integer, which is not necessarily closer to zero.

Use this calculator when a mathematical rule calls for a whole number that must not exceed the original value. The notation ⌊x⌋ means floor of x. It differs from rounding to the nearest integer and from simply removing the digits after the decimal point.

How to Find the Floor of a Number

  1. Enter the signed Real number x. Include a minus sign for a negative value.
  2. Select Calculate to read the featured floor and compare the ceiling, fractional part and entered value.
  3. Check the bounding interval: floor(x) ≤ x < floor(x) + 1.
  4. If x is already an integer, its floor and ceiling both equal x. Do not move to another integer merely because the operation says “down.”

Floor always selects the greatest integer that does not exceed x. For −3.7 it selects −4, whereas removing the fractional digits toward zero would give −3. The fractional part here is x − floor(x), so it is nonnegative even for a negative input.

The floor and ceiling operate on the internal floating-point value. The fractional part rounds to ten decimals, so a fraction just below 1 can display as 1. Very large numbers and values extremely close to integer boundaries can be affected by representation limits. The diagram illustrates the rule rather than plotting an entered value.

Floor, Ceiling and Fractional Part Formulas

n = floor(x) = ⌊x⌋

n ≤ x < n + 1

Ceiling: m = ceil(x) = ⌈x⌉, with m − 1 < x ≤ m

Fractional part f = x − floor(x), with 0 ≤ f < 1

The PHP floor definition matches the greatest-integer rule used here. Ceiling selects the smallest integer at or above x, while truncation removes a fractional part toward zero. They answer different rounding questions.

For negative decimals, floor lies to the left of the input on the number line. Since −4 ≤ −3.7 < −3, the floor is −4 and the fractional part is −3.7 − (−4) = 0.3.

The interval and fractional bounds are mathematical statements about the underlying value. The shortened fractional-part display can reach 1 through rounding even though the exact fraction is below 1. This page applies floor to one number; floor division first divides two numbers, then applies floor.

Input and Integer Boundary Results

Real number x
Signed numeric input. An integer remains unchanged by floor.
Floor of x
Featured greatest integer at or below x.
Ceiling
Smallest integer at or above x, useful for comparing capacity rounding.
Fractional part
x − floor(x), rounded to ten decimals. Nonnegative mathematically; can display as 1 near a boundary.
Entered value
Floating-point value used internally, rather than an arbitrary-precision digit string.
Bounding interval
Shows floor(x) ≤ x < floor(x) + 1 to help check the result.

Floor of a Negative Decimal Example

Illustrative example. Enter x = −3.7. The surrounding integers are −4 and −3. Since −4 ≤ −3.7 < −3, the floor is −4.

The ceiling is −3. The fractional part is x − floor(x) = −3.7 − (−4) = 0.3.

Truncating toward zero would give −3, which is above the input and therefore fails the floor definition. The negative sign is why removing decimal digits is the wrong shortcut here.

Calculation check. These illustrative values were checked independently against the formula and calculator response. Retain unrounded intermediate values when checking approximations.

Floor of a Negative Decimal Example
OutputValue
Floor−4
Ceiling−3
Fractional part0.3
Bounding interval−4 ≤ −3.7 < −3

Floor, Ceiling and Truncation Compared

These operations agree on integers but can differ on decimals. For a negative noninteger, floor is lower than truncation. The table is mathematical comparison, not an additional input mode.

Floor, Ceiling and Truncation Compared
xFloorCeilingTruncation
3.7343
−3.7−4−3−3
−0.2−100
4444
0000

When to Use Floor Instead of Ceiling

Floor is useful for counting complete groups. If 23 meters of material is divided into pieces that each require 4 meters, the quotient is 5.75. Its floor, 5, counts the complete pieces before considering any extra allowance for cutting.

Use a different operation when you need enough capacity to cover everything. A trip with 23 passengers and vehicles holding 4 passengers each requires the ceiling of 5.75, which is 6 vehicles. Floor would count full groups and leave three passengers unaccounted for.

Floor applied after division

Suppose a shelf has 95 centimeters of usable space and each box occupies 18 centimeters. Calculate 95 ÷ 18 ≈ 5.2778, then take its floor to obtain five complete boxes. Multiplying back gives 5 × 18 = 90 centimeters, leaving five centimeters unused. A sixth box would require 108 centimeters, exceeding the shelf width.

The physical calculation still depends on the measurements: gaps, packaging and required clearance change the usable dimensions. Floor is the final mathematical operation, not a replacement for defining the available space correctly.

A floor is not always the appropriate practical answer. Use floor for how many complete equal-size units fit; use ceiling when any partial unit requires another whole unit of capacity. Define the physical constraints before selecting a rounding rule.

For a negative input, the fractional part is not just the digits after the decimal point with a minus sign. For −3.7, x − floor(x) is +0.3. This convention is useful for locating a value within its unit interval.

Common Floor Function Mistakes

  • Dropping the decimal part of a negative input instead of selecting the lower integer.
  • Confusing floor with rounding to the nearest integer.
  • Subtracting 1 from an input that is already an integer.
  • Using floor when enough capacity requires a ceiling.
  • Assuming the fractional part must have the input’s sign.
  • Treating the shortened fractional-part display as exact near an integer boundary.

Frequently Asked Questions

What does floor mean in math?

The floor of x is the greatest integer less than or equal to x, written ⌊x⌋. It rounds toward negative infinity rather than to the nearest integer.

What is the floor of a negative decimal?

Select the lower integer on the number line. For −3.7, floor is −4 because −4 ≤ −3.7 < −3.

Is floor the same as removing decimal digits?

For nonnegative numbers they agree. For a negative noninteger, removing fractional digits moves toward zero and differs from floor.

What happens when the input is already an integer?

It remains unchanged. For example, floor(−7) = −7 and floor(0) = 0.

How is ceiling different from floor?

Ceiling selects the smallest integer at or above the input. Floor selects the greatest integer at or below it. They agree on integers.

Why is the fractional part of −3.7 positive?

This page defines it as x − floor(x). Therefore −3.7 − (−4) = 0.3, which locates the input within its unit interval.

Why can the fractional part display as 1?

It rounds to ten decimals. An exact fraction just below 1 can therefore display as 1, even though the mathematical fractional part is always below 1.

Should I use floor to decide how much capacity to buy?

Use it to count complete groups that fit. If any partial group needs another whole unit of capacity, ceiling is usually the relevant rounding rule.

Sources and References