Skip to main content

Floor & Ceiling Calculator – Round Any Number

Quick answer

floor(x) rounds down and ceil(x) rounds up: floor(2.7)=2, ceil(2.7)=3, floor(−2.1)=−3, ceil(−2.1)=−2.

  • Compare with truncation.

Figures are estimates from this calculator’s standard formula — adjust the inputs in the tool below for your exact number.

How the Floor and Ceiling Calculator Works

⌊x⌋ = greatest integer ≤ x | ⌈x⌉ = smallest integer ≥ x

Floor and ceiling bracket a number between the integers just below and just above it. For 2.7: floor drops to 2 and ceiling rises to 3. Negatives flip intuition — floor(−2.1) = −3 (not −2!) because −3 is the greatest integer still ≤ −2.1, while ceil(−2.1) = −2. The calculator prints both functions side by side with the integer interval they form, and contrasts truncation, which merely deletes decimals and agrees with floor only for positives (trunc(−2.1) = −2 ≠ floor). Real logic leans on these functions daily: ceiling determines how many 6-person tables seat 20 guests (⌈20/6⌉ = 4), floor converts 250 seconds to whole minutes (⌊250/60⌋ = 4), and pagination computes page = ⌊index/itemsPerPage⌋. Exact integers pass through unchanged: floor(5) = ceil(5) = 5.

  1. 1

    Enter any real number

    Positive, negative, decimal — both functions are computed

  2. 2

    Read the floor

    The greatest integer less than or equal to your input

  3. 3

    Read the ceiling

    The smallest integer greater than or equal to your input

  4. 4

    Compare with truncation

    Differences appear for negative inputs

Use Cases

Capacity Planning

⌈20/6⌉ = 4 tables needed for 20 guests at 6 per table

Pagination

Page numbers come from ⌊offset/pageSize⌋

Time Conversions

⌊250/60⌋ = 4 whole minutes in 250 seconds

Tips

  • 1

    floor(−2.1) = −3 — negatives round away from zero on floor

  • 2

    ceil(b/a) answers "how many groups of a cover b"

  • 3

    Integers are fixed points: floor(5) = ceil(5) = 5

Common Mistakes

  • Assuming floor(−2.1) = −2; it is −3

  • Mixing up which of the two rounds toward zero for negatives

  • Using ceiling when whole groups are wasted — 20/6 needs 4 tables (ceil), not 3

  • Confusing truncation with floor for negative decimals

FAQs

What are floor(2.7) and ceil(2.7)?

floor = 2, ceil = 3.

What is floor(−2.1)?

−3: the greatest integer ≤ −2.1. Truncation would say −2.

How many 6-seat tables for 20 people?

ceil(20/6) = 4 tables.

Do floor and ceil change integers?

No — floor(5) = ceil(5) = 5.

Floor vs truncation for −7.9?

floor = −8, trunc = −7. They agree only on non-negatives.