Hacker News new | past | comments | ask | show | jobs | submit login

Slightly off-topic: didn't know what ⌊x/2⌋ is

Google: x squared (???)

GPT: The expression ⌊x/2⌋ represents the greatest integer that is less than or equal to x/2. It is called the floor function of x/2. For example, if x=5, then ⌊x/2⌋ = ⌊5/2⌋ = 2. If x is an even integer, then ⌊x/2⌋ = x/2. If x is an odd integer, then ⌊x/2⌋ = (x-1)/2.




I expect Google is stripping the ⌊ ⌋ brackets out as punctuation in the search, so that you're effectively only searching for "x2", hence the "x squared" results.


I was aware of the floor function (and the corresponding ceiling function) since I’m a software engineer. But I wasn’t aware that you could graph it. It never came up in high school or college math. And I never thought about it. Of course, it makes sense now that I’ve seen it.


It's also sometimes referred to as a step-function though i believe that name encompasses many more functions than just the floor


It's piecewise-linear and periodic. Also called sawtooth. Step functions are piecewise constant. It would not be fun to climb steps of this shape.


Yeah, in college I’ve worked with step/unit functions in both my “differential equations” and “signal and systems” classes for sure.

But it never occurred to me and it was never presented by professors or TAs that they were essentially the same as floor/ceiling functions.

Or maybe I just forgot since it’s been more than a decade?


Can you name a single-variable function that software engineers use that can't be graphed?

How would such a function be useful?


No. I think the term “function” is overloaded here.

My point was that I viewed it solely as a _programming_ function and not a _mathematical_ function (even though it exists in math libraries), hence my last sentence “Of course, it makes sense now that I’ve seen it.”

Out of all the functions in math libraries that I’ve used, floor/ceiling are the only ones where I had this idea for some reason. It was obvious to me that Math.sin(x) and Math.abs(x) can be graphed. I’ve seen those graphs over and over again. But whenever I used the floor or ceiling functions, I just thought in terms of rounding up or down with a predetermined rule to finish whatever piece of code I was working on.

But as others have pointed out, I have actually worked with the floor function as a mathematical function in several math classes. I have seen the graphs. They just weren’t called floor or ceiling functions.

I just never made the connection that they were the same and I don’t recall any computer science professor or TA “bridging the gap” to what was learned in the math classes.


Sorry about this. I added an explanation to the article.


It's the floor operator. Also known as round down.



APL, famous for baffling programmers with weird notation, also known for making one part of math more readable :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: