698 tools
All

Ceiling and Floor Calculator

Calculate the floor (greatest integer ≤ x) and ceiling (least integer ≥ x) of a number.

 

Floor
Ceiling

About this calculator

Use this calculator to snap a real number to the neighbouring integers. Floor(3.2) is 3 and ceil(3.2) is 4. For a negative, floor(−3.2) is −4 (more negative) and ceil(−3.2) is −3. Integers are unchanged: floor(5) = ceil(5) = 5.

This is not rounding to nearest; 3.2 floors to 3 even though it is closer to 3 than to 4 would still floor the same way. Truncation toward zero is a different rule (trunc(−3.2) is −3).

x: Any finite real number.

Floor: Greatest integer ≤ x.

Ceiling: Least integer ≥ x.