I would say that all programming languages have functions with these names to select the smaller or the larger of the two values:
min() and max()floor()and ceil()/ceiling()
And some languages have both. JavaScript, I believe, is one example.
I was always a little blurred in the difference between the previous pair and the last pair. I have a vague impression that min/ maxare more simplified and floor/ are ceilingmore mathematical, but this is not so much.
Oddly enough, I can't find this anywhere on StackOverflow or the web, searching Google. So, are there some guidelines or rules of thumb to decide which of these features to use when your programming language offers both?
source
share