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). ...
🌐
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.
Discussions

How do you use floor/ceil in math, e.g. how does it work exactly? - Mathematics Stack Exchange
I read the Wiki, but I am still somewhat confused. Supposedly floor returns the number lowest, and ceil the number highest. However, I am not sure I understand how this works in freehand form, or ... More on math.stackexchange.com
🌐 math.stackexchange.com
November 26, 2013
Can someone explain to me what the floor and cealing functions are actually doing numerically?
“Mathematical operations” (i.e. arithmetic) are only a small part of math. A relation is simply a mapping of elements in one set to elements in another set, and that’s what the floor and ceiling functions do. More on reddit.com
🌐 r/learnmath
30
4
June 26, 2022
What's the difference between the pair of functions floor()/ceil() and min()/max()? - Stack Overflow
I've always been a bit fuzzy on the difference between the former pair and the latter pair. I have a vague impression that min/max are more simplistic and floor/ceiling are more mathematical, but that's not much to go on. More on stackoverflow.com
🌐 stackoverflow.com
Difference between ceil and floor function in abap? - Stack Overflow
I'm newbie to abap, please let me know ,the use of ceil and floor function in abap. More on stackoverflow.com
🌐 stackoverflow.com
🌐
GeeksforGeeks
geeksforgeeks.org › mathematics › difference-between-floor-and-ceil-function
Difference Between Floor and Ceil Function - GeeksforGeeks
October 1, 2024 - Floor function is used in situations where exact integer values are required which is just lesser than or equal to the given value. For example, ceil value of 3.883 is 3.
🌐
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.
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

🌐
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...

Find elsewhere
🌐
Sololearn
sololearn.com › en › Discuss › 2672320 › i-am-confused-between-floor-ceil-and-round-functions-in-c-programming-could-you-please-explain-it-down-here-
I am confused between floor(), ceil() and round() functions in C Programming. Could you please explain it down here? 🙏🥺 | Sololearn: Learn to code for FREE!
See there a trick floor means down so if any no. like 25.6 it will go down remaining 25. And in ceil it means top so if any no. like 25.6 is taken it'll go up that's 26. In round function that's pretty simple if value after . is greater than 5 then add 0.5 to the no....
🌐
BYJUS
byjus.com › maths › ceiling-function
Ceiling Function Definition
June 7, 2022 - Example: Find the ceiling value of 3.7. ... As we can see, the integer more than 3.7, are 4,5,6,7,..and so on. The nearest integer is here 4. ... Floor function is the reverse function of the ceiling function.
🌐
GeeksforGeeks
geeksforgeeks.org › python › floor-ceil-function-python
floor() and ceil() function Python - GeeksforGeeks
Apart from using the math module, we can also compute the floor and ceil of a float using basic arithmetic operations like floor division (//) and addition.
Published   January 16, 2026
🌐
Maplesoft
maplesoft.com › support › help › maple › view.aspx
Floor and Ceiling Functions - Maple Help
The Floor Function and the Ceiling Function Main Concept The floor of a real number x , denoted by , is defined to be the largest integer no larger than x . The ceiling of a real number x , denoted by , is defined to be the smallest integer no smaller...
🌐
YouTube
youtube.com › watch
A ceiling and floor equation - YouTube
In this video , I showed how to solve a simple ceiling and floor equation
Published   May 16, 2025
🌐
Quora
quora.com › What-is-the-difference-between-ceil-and-floor-in-PHP
What is the difference between ceil() and floor() in PHP? - Quora
Answer (1 of 3): The ceil() function rounds a number UP to the nearest integer. example: [code]echo(ceil(0.60) ); echo(ceil(1.40) ); Output: 1 2 [/code]The floor() function returns the largest integer value that is smaller than or equal to a number. ...
🌐
Difference Between
differencebetween.net › technology › software-technology › difference-between-ceil-and-floor-functions
Difference Between Ceil and Floor Functions | Difference Between | Ceil vs Floor Functions
August 21, 2011 - Ceil and floor functions are different in many respects. For example, ceil function returns the least value of the integer that is greater than or equal to the specified number. On the other hand, floor function gets the greatest value that is less than or equal to the specified number.
🌐
Mathematics LibreTexts
math.libretexts.org › bookshelves › combinatorics and discrete mathematics › elementary number theory (clark) › 1: chapters
1.4: The Floor and Ceiling of a Real Number - Mathematics LibreTexts
August 17, 2021 - From now on we mostly concentrate on the floor \(\lfloor x \rfloor\). For a more detailed treatment of both the floor and ceiling see the book Concrete Mathematics [5]. According to the definition of \(\lfloor x \rfloor\) we have \[\label{eq:1}\lfloor x\rfloor =\max\{n\in\mathbb{Z}\mid n\leq\}\] Note also that if \(n\) is an integer we have: \[\label{eq:2}n=\lfloor x\rfloor \Longleftrightarrow n\leq x<n+1.\] From this it is clear that \[{\mbox{$ \lfloor x \rfloor $}} \le x \mbox{ holds for all $x$},\nonumber\] and \[{\mbox{$ \lfloor x \rfloor $}} = x \Longleftrightarrow x \in \mathbb{Z}.\nonumber\] We need the following lemma to prove our next theorem.
🌐
Suneet Agrawal
agrawalsuneet.github.io › blogs › round-vs-floor-vs-ceil-swift
Round vs Floor vs Ceil : Swift · Suneet Agrawal
March 4, 2024 - 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....
🌐
Educative
educative.io › answers › mathceil-mathfloor-and-mathround-in-javascript
Math.ceil, Math.floor, and Math.round in JavaScript
September 13, 2004 - While the Math.ceil method returns the smallest integer greater than or equal to the value we pass, Math.floor returns the largest or equal integer that is less than the given value.