“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. Answer from Away-Reading on reddit.com
🌐
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...

🌐
Reddit
reddit.com › r/learnjavascript › math - floor vs ceil vs round vs trunc | javascript
r/learnjavascript on Reddit: Math - floor vs ceil vs round vs trunc | JavaScript
April 11, 2022 - Math - floor vs ceil vs round vs trunc | JavaScript · r/JavaScriptTips • · r/JavaScriptTips · A place to get a quick fix of JavaScript tips and tricks to make you a better Developer. Members · Online · youtube · upvotes · How to “think” in JavaScript ·
🌐
Reddit
reddit.com › r/cpp_questions › looking for a kind soul to assist with 'floor' and 'ceil' in c++
r/cpp_questions on Reddit: Looking for a kind soul to assist with 'floor' and 'ceil' in C++
December 11, 2022 -

Soooo, I am very green/new to any type of code and programming. I understand the base concept of the floor/ceil. Functions but unsure how to incorporate them to my current code. I can give brief details of deliverables. Prompt user to input 2 values to be converted from Celsius to Fahrenheit. Determine which of the 2 is the "start/stop" values. Once start and stop are determine, the program converts every value in the range input from user to Fahrenheit, in 1 degree increments.

I have all of the code complete.. my issue is floor and ceil functions just won't round up or down as expected. Not proficient enough to determine where my code needs to be tweaked. Please help. Thank you. The "start" value should round down and the stop value should round up. My code either rounds both up or down.

Willing to elaborate more if the above doesnt make sense.. with anyone willing to help.

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

Find elsewhere
🌐
Reddit
reddit.com › r/whatnotapp › whatnot repacks floor average ceiling . which is more important?
r/whatnotapp on Reddit: Whatnot Repacks Floor Average Ceiling . which is more important?
January 17, 2024 -

Average is most important! Floor and ceiling can be a BS sales tactic! Don’t ask the floor and ceiling unless you ask the average too!
$1 floor $750 ceiling says I can put a $3 card in that repack. Ask the average! The average is the most important number. If the seller makes up a fake average stay away! Pay attention! The seller doesn’t know the average of their repacks then you’re most likely getting a floor dollar amount value. 20 repacks cannot have an average of $200 and you keep pulling out $8 $10 cards. That’s not the average! Sit back and watch. If the breakers says average is $150 and they keep pulling out $30 cards. Then that breaker is FOS and is throwing out fake numbers to get you to buy in his break. Spend your money wisely! Don’t be manipulated! If the floor says $1 then you may get a $4 card oh well! 🤷🏽. What’s even better is when the breakers say you won’t get a $1 card they won’t do you like that. Then why have $1 floor in the first place. They Make that floor $20 but won’t because they repack $8 cards. Get it?

🌐
Reddit
reddit.com › r › learnmath › comments › 1grr0wf › kinda_confused_over_x_floor_and_x_ceil
kinda confused over ⌊x⌋ (floor) and ⌈x⌉ (ceil) : r/learnmath
March 10, 2024 - OK I cooked too much C++. Is floor, in a mathematical and not a C++ sense, the closest integer to x towards 0, or the greatest integer smaller than x? And is ceil, the closest integer to x away from 0, or the smallest integer greater than x?
🌐
SQL Studies
sqlstudies.com › 2016 › 10 › 05 › floor-round-and-ceiling
Floor, Round, and Ceiling | SQL Studies
November 8, 2016 - » · « Becoming a Microsoft MVP · Rich Slabbekoorn says: November 8, 2016 at 4:00 PM · 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.
🌐
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.
🌐
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 ...
🌐
Reddit
reddit.com › r/java › why floor, round and ceil return double?
r/java on Reddit: Why floor, round and ceil return double?
September 12, 2013 -

Might be stupid question, but this has always puzzled me about Java.

Why functions Math.floor(), Math.round() and Math.ceil() return double value?

I thought main point of those is to convert floating point number into whole number. So why not returning long or int? That way we don't have to manually cast everytime.

🌐
Reddit
reddit.com › r/learnmath › [basic]floor and ceiling functions
r/learnmath on Reddit: [Basic]Floor and Ceiling Functions
March 23, 2015 -

So I have this question from my class which I just don't understand.

1)Give two non-integer real numbers x and y for which

Ceiling(x) × y = x × Floor(y)

2)Prove that for all real x ,

Ceiling(x) − 1 = − Floor(-x) −1

Full marks can only be achieved by using indirect equality.

I really just don't understand this, any help would be appreciated.

edit: formatting

🌐
Wikipedia
en.wikipedia.org › wiki › Floor_and_ceiling_functions
Floor and ceiling functions - Wikipedia
February 5, 2026 - In mathematics, the floor function ... 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). ......
🌐
Reddit
reddit.com › r/mathematics › how to express a floor function in terms of neither a floor or ceiling function?
r/mathematics on Reddit: How to express a floor function in terms of neither a floor or ceiling function?
October 29, 2023 -

I know I can express floor(a) in many ways involving summation, ceiling functions, etc. Is there a way to express a general floor function without the use of the floor function itself or the ceiling function?

🌐
Reddit
reddit.com › r/learnmath › is this a correct approach? ceiling/floor function problem
r/learnmath on Reddit: Is this a correct approach? ceiling/floor function problem
March 2, 2023 -

Hi! I know this is false thanks to a counter example. But I wanted to try if it could be possible to proof this in another way. I would like to know if this is just math riberish or it's correct (at least what I completed of the "proof").

...............

The problem is:

Prove or disprove each of these statements about the floor and ceiling function:

...............

⌈x/2⌉ = ⌊(x+1)/2⌋

...............

My solution:

let x = n - e, where n is an integer and 0 <= e < 1

...............

Solving by cases we have:

...............

  1. 0 <= e < 1/2

    x = n - e

    ⌈x⌉ = n

    (n - 1) < x <= n

    [(n - 1)/2] < x/2 <= n/2

    ...............

    Here we have two more cases:

1.1 n is even

n = 2q

then we have

[(2q - 1)/2] < x/2 <= 2q/2

(q - (1/2)) < x/2 <= q

Becase (q - 1/2) < x/2, then

(q - 1) < x/2

Therefore:

(q - 1) < x/2 <= q

This is the definition of ceiling function

⌈x/2⌉ = q

...............

1.2 n is odd

n = 2k + 1

[(2k + 1 -1)/2] < x/2 <= (2k + 1)/2

k < x/2 <= (k + 1/2)

Because x/2 <= (k + 1/2) then

x/2 <= k + 1

Note: I just realized that I can't assume

this since x/2 can be less or EQUAL to (k +1/2), right?

🌐
GitHub
gist.github.com › z2015 › 5e20455d01ece6d3a1a6d9f09156fba6
ceil vs floor vs round · GitHub
ceil vs floor vs round · Raw · ... 1 Math.ceil(4); // 4 Math.ceil(7.004); // 8 · The Math.floor() function returns the largest integer less than or equal to a given number....