functions of a real returning respectively the largest smaller and the smallest larger integer
{\displaystyle \lfloor x\rfloor =x-\{x\}}
{\displaystyle \lfloor x\rfloor =m}
{\displaystyle \lfloor x\rfloor }
{\displaystyle \lfloor x\rfloor \leq \lceil x\rceil ,}
In mathematics, the floor function is the function that takes as input a real number x, and gives as output the greatest integer less than or equal to x, denoted ⌊x⌋ or … Wikipedia
🌐
Wikipedia
en.wikipedia.org › wiki › Floor_and_ceiling_functions
Floor and ceiling functions - Wikipedia
February 5, 2026 - In mathematics, the floor function is the function that takes as input a real number x, and gives as output the greatest integer less than or equal to x, denoted ⌊x⌋ or floor(x). Similarly, the ceiling function maps x to the least integer greater than or equal to x, denoted ⌈x⌉ or ceil(x). ...
Top answer
1 of 3
3

Simply put it's two ways of thinking of rounding off a number. Ceiling rounds up to nearest integer. Floor rounds down to nearest integer. If the number is an integer, nothing happens.

2 of 3
3

It's easy to think about floor and ceil from the perspective of the number line. Let's say you have some decimal number, (I'm going to be using this number as an example throughout my answer)
So, as you can see, the functions just return the nearest integer values.
floor returns the nearest lowest integer and ceil returns the nearest highest integer.

All real numbers are made of a characteristic (an integer part) and mantissa (a fractional part)

When floor a number, you can think of it as replacing the Mantissa with

and ceil can be thought of as replacing the mantissa with .

That's not a very popular way of thinking about it but it was the way I thought about it when I first started using it in programming.

Remember, the number remains the same when it is an integer. ie, floor() ceil()


Let's now look at the proper definitions along with the graphs for them.

Floor Function: Returns the greatest integer that is less than or equal to

Ceiling Function: Returns the least integer that is greater than or equal to

Don't let the infinite staircase scare you. It's much more simpler than it seems. Those "line-segments" that you see are actually called piecewise-step functions.

Simply, the black dot represents 'including this number' and the white represents 'excluding this number'. Meaning that each segment actually is from x to all numbers less than x+1.


Let's look at 2.31 and how it would look on both the graphs at once. You can see that the line hits the floor function at the "line-piece" for and hits the ceiling function at

🌐
GeeksforGeeks
geeksforgeeks.org › python › floor-ceil-function-python
floor() and ceil() function Python - GeeksforGeeks
To get the ceiling, just add 1 to the floor value (i.e., x // 1 + 1).
Published   January 16, 2026
🌐
Reddit
reddit.com › r/learnmath › can someone explain to me what the floor and cealing functions are actually doing numerically?
r/learnmath on Reddit: Can someone explain to me what the floor and cealing functions are actually doing numerically?
June 26, 2022 -

When I truncate a number what my brain actually does is ignoring the fractional part of said number. But its not doing any real math.

I understand I can express a truncate function with conditional floor and cealing functions... but thats is not what I need.

I need someone to teach me how to arrive from a number to its integer using only mathematical operations and not logical functions.

I need to know...

Plz help me someone...

🌐
Math is Fun
mathsisfun.com › sets › function-floor-ceiling.html
Floor and Ceiling Functions
The floor and ceiling functions give us the nearest integer up or down. The Floor of 2.31 is 2 The Ceiling of 2.31 is 3.
Find elsewhere
🌐
Bizzdesign
help.bizzdesign.com › articles › horizzon-help › floor-ceil-trunc-round-function
floor, ceil, trunc, round function
January 23, 2026 - Find help on all features available in the Bizzdesign Alfabet solution · Submit your questions, requests, and issues for the Alfabet solution
🌐
GeeksforGeeks
geeksforgeeks.org › mathematics › difference-between-floor-and-ceil-function
Difference Between Floor and Ceil Function - GeeksforGeeks
October 1, 2024 - So, ceil(0.34) is 1. ... Floor means the floor of our home. So, we can pick out some similarities from here.
🌐
MathWorks
mathworks.com › matlab › mathematics › elementary math › arithmetic operations
ceil - Round toward positive infinity - MATLAB
The ceil function can calculate on all variables within a table or timetable without indexing to access those variables. All variables must have data types that support the calculation. For more information, see Direct Calculations on Tables and Timetables. fix | floor | round ·
🌐
DataLemur
datalemur.com › sql-tutorial › sql-tutorial-mathematical-functions
SQL Math Functions: ABS, CEIL, FLOOR, ROUND Examples
![SQL CEIL and FLOOR Functions Example](https://api.datalemur.com/assets/a8235fe1-6ea6-442c-8567-e79e570eec4f) ## POWER(): Calculating Squared Values In this scenario, we'll explore the concept of squared values by focusing on the 3 popular tech stocks: Apple ('AAPL'), Google ('GOOG'), and ...
🌐
MathWorks
mathworks.com › fixed-point designer › data type exploration › fixed-point specification › fixed-point specification in matlab › fixed-point math functions
ceil - Rounds toward positive infinity - MATLAB
The ceil function rounds values to the nearest integer toward positive infinity. The fix function rounds values to the nearest integer toward zero. The floor function rounds values to the nearest integer toward negative infinity.
🌐
GeeksforGeeks
geeksforgeeks.org › c++ › ceil-floor-functions-cpp
Ceil and Floor functions in C++ - GeeksforGeeks
May 16, 2025 - C++ provides floor() and ceil() functions, defined in the <cmath> header file, to find the rounded-down and rounded-up values of floating-point numbers
🌐
Cuemath
cuemath.com › algebra › floor-and-ceiling-function
Floor Function and Ceiling Function - Definition, Formulas, Properties, Examples
The floor function gives an integer number value which is a numeric value lesser than the value of the function, and a ceiling function gives an integer number value which is a numeric value greater than the value of the function.
🌐
SQL Studies
sqlstudies.com › 2016 › 10 › 05 › floor-round-and-ceiling
Floor, Round, and Ceiling | SQL Studies
November 8, 2016 - Your description of FLOOR is incorrect. It works similar to CEILING in that it returns the integer equal to or lower than the value passed in.
🌐
YouTube
youtube.com › watch
[Discrete Mathematics] Floor and Ceiling Examples - YouTube
We introduce the floor and ceiling functions, then do a proof with them.LIKE AND SHARE THE VIDEO IF IT HELPED!Visit our website: http://bit.ly/1zBPlvmSubscri...
Published   May 24, 2016
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Math › floor
Math.floor() - JavaScript | MDN
console.log(Math.floor(5.95)); // Expected output: 5 console.log(Math.floor(5.05)); // Expected output: 5 console.log(Math.floor(5)); // Expected output: 5 console.log(Math.floor(-5.05)); // Expected output: -6 ... The largest integer smaller than or equal to x. It's the same value as ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Math › ceil
Math.ceil() - JavaScript | MDN
Math.ceil(x) x · A number. The smallest integer greater than or equal to x. It's the same value as -Math.floor(-x). Because ceil() is a static method of Math, you always use it as Math.ceil(), rather than as a method of a Math object you created (Math is not a constructor).
🌐
Suneet Agrawal
agrawalsuneet.github.io › blogs › round-vs-floor-vs-ceil-swift
Round vs Floor vs Ceil : Swift · Suneet Agrawal
June 21, 2022 - Although they round to the nearest ... x.5 to x.99 -> x+1.0 · -x to -x.49 -> x.0 · -x.5 to -x.99 -> -x-1.0 · floor rounds up to the nearest Integer which can be equal to or below the actual value....
🌐
PHP
php.net › manual › en › function.ceil.php
PHP: ceil - Manual
<?php // round_up: // rounds up a float to a specified number of decimal places // (basically acts like ceil() but allows for decimal places) function round_up ($value, $places=0) { if ($places < 0) { $places = 0; } $mult = pow(10, $places); return ceil($value * $mult) / $mult; } // round_out: // rounds a float away from zero to a specified number of decimal places function round_out ($value, $places=0) { if ($places < 0) { $places = 0; } $mult = pow(10, $places); return ($value >= 0 ? ceil($value * $mult):floor($value * $mult)) / $mult; } echo round_up (56.77001, 2); // displays 56.78 echo round_up (-0.453001, 4); // displays -0.453 echo round_out (56.77001, 2); // displays 56.78 echo round_out (-0.453001, 4); // displays -0.4531 ?>