Floor and Ceiling FunctionsPosted on: May 3, 2018, by : xnlamp
Choose thegreatestone (which is2in this case)
But I prefer to use the word form:floor(x) andceil(x)
The Int function (short for integer) is like the Floor function, BUT some calculators and computer programs show different results when given negative numbers:
The floor and ceiling functions give us the
Floor Function: the greatest integer that is less than or equal tox
How do we give this a formal definition?
… and it has to beless than(or maybe equal to) 2.31, right?
The symbols for floor and ceiling are like the square brackets[ ]with the top or bottom part missing:
The Floor Function is this curious step function (like an infinite staircase):
So: frac(3.65) = (3.65) floor(3.65) = (3.65) (4) = 3.65 + 4 =0.35
So: frac(3.65) = 3.65 floor(3.65) = 3.65 3 =0.65
Here are some example values for you:
With the Floor Function, we throw away the fractional part. That part is called the frac or fractional part function:
A solid dot means including and an open dot means not including.
Oh no! There are lots of integers less than 2.31.
So be careful using this function with negative values.
Ceiling Function: the least integer that is greater than or equal tox
What if we want the floor or ceiling of a number that is already an integer?
BUTmany calculators and computer programs usefrac(x) = x int(x), and so their result depends on how they calculateint(x):
Thegreatestinteger that isless than(or equal to) 2.31 is2