Connexions

You are here: Home » Content » Greatest and least integer functions
Content Actions

Greatest and least integer functions

Module by: Sunil Kumar Singh

In this module, we shall study a family of functions which return integers based on certain rule, corresponding to a real number. Greatest integer function (floor), least integer function (ceiling) and nearest integer function form part of this family.

Greatest integer function (Floor function)

Greatest integer function returns the greatest integer less than or equal to a real number. In other words, we can say that greatest integer function rounds “down” any number to the nearest integer. This function is also known by the names of “floor” or “step” function.
Interpretation of Greatest integer function is straight forward for positive number. Consider the values “0.23” and “1.7”. The greatest integers for two numbers are “0” and “1”. Now, consider a negative number “-0.54” and “-2.34”. The greatest integers less than these negative numbers are “-1” and “-3” respectively.
We can observe here that greater integer function is actually a function that returns the integral part of a positive real number. This interpretation is clear for positive number. Interpretation for negative numbers needs some explanation. We interpret these values in the context of the fact that every real number can be decomposed to have two parts (i) integral and (ii) fractional part. From this point of view, the negative number can be thought as :
-0.54 (real number) = -1 (integral part) + 0.36 (fraction part) -0.54 (real number) = -1 (integral part) + 0.36 (fraction part)
-2.34 (real number) = -3 (integral part) + 0.66 (fraction part) -2.34 (real number) = -3 (integral part) + 0.66 (fraction part)
We may be tempted to disagree (why not -2 + -0.34 = -2.34?). But, we should know that this is how greatest integer function treats a negative number. Subsequently, we shall define a function that returns fraction part. We shall find that the function exactly returns the same fraction for negative number as has been worked out.
The greatest integer function is denoted by the symbol “[x]” . Working rules for evaluating greatest integer function are two step process :
  1. If “x” is an integer, then [x] = x.
  2. If “x” is not an integer, then [x] evaluates to greatest integer less than “x”.
In the nutshell, we can use any of the following interpretations of greatest integer function :
  • [x] = Greatest integer less than equal to “x”
  • [x] = Greatest integer not greater than “x”
  • [x] = Integral part of “x”
The value of "[x]" is an integer (n) such that :
f x = [ x ] = n ; if n x < n + 1 n Z f x = [ x ] = n ; if n x < n + 1 n Z

Graph of greatest integer function

Few initial function values are :
F o r - 2 x < - 1, f x = [ x ] = - 2 F o r - 2 x < - 1, f x = [ x ] = - 2
F o r - 1 x < 0, f x = [ x ] = - 1 F o r - 1 x < 0, f x = [ x ] = - 1
F o r 0 x < 1, f x = [ x ] = 0 F o r 0 x < 1, f x = [ x ] = 0
F o r 1 x < 2, f x = [ x ] = 1 F o r 1 x < 2, f x = [ x ] = 1
F o r 2 x < 3, f x = [ x ] = 2 F o r 2 x < 3, f x = [ x ] = 2
The graph of the function is shown here :
Greatest integer function
fc1.gif
Figure 1: The domain of the function is R.
This function is known as step function as values of function steps by "1" as we switch values of “x” from one interval to another. We see that there is no restriction on values of "x" and as such its domain has the interval equal to that of real numbers. On the other hand, the step function or greatest integer function evaluates only to integer values. It means that the range of the function is set of integers, denoted by "Z". Hence,
D o m a i n = R D o m a i n = R
R a n g e = Z R a n g e = Z

Important properties

Certain properties of greatest integer function is presented here :
1: If and only if at least either “x” or “y” is an integer, then :
| x + y | = | x | + | y | | x + y | = | x | + | y |
For example, let x = 2.67 and y = 0.63. Then,
| x + y | = | 2.27 + 0.63 | = | 2.9 | = 2 | x + y | = | 2.27 + 0.63 | = | 2.9 | = 2
| x | + | y | = | 2.27 | + | 0.63 | = 2 + 1 = 3 | x | + | y | = | 2.27 | + | 0.63 | = 2 + 1 = 3
However, if one of two numbers is integer like x = 2 and y = 0.63, then the proposed identity as above is true.
2: If “x” belongs to integer set, then :
| x | + | - x | = 0 ; x Z | x | + | - x | = 0 ; x Z
For example, let x = 2.Then
| 2 | + | - 2 | = 2 2 = 0 | 2 | + | - 2 | = 2 2 = 0
We can use this identity to test whether “x” is an integer or not?
3: If “x” does not belong to integer set, then :
| x | + | - x | = - 1 ; x Z | x | + | - x | = - 1 ; x Z
For example, let x = 2.7.Then
| 2.7 | + | - 2.7 | = 2 3 = - 1 | 2.7 | + | - 2.7 | = 2 3 = - 1

Fraction part of a real number

We define a function denoted by “{x}” as :
{ x } = x [ x ] { x } = x [ x ]
This function returns fraction part of the number, when “x” is not an integer. This exception of non-integral “x” is important. For this reason, we avoid to call it fraction part function. Zero is not a fraction. For integer "x", the function evaluates to zero :
{ 5 } = 5 [ 5 ] = 5 5 = 0 { 5 } = 5 [ 5 ] = 5 5 = 0
{ 5 } = 5 [ 5 ] = 5 + 5 = 0 { 5 } = 5 [ 5 ] = 5 + 5 = 0
Let us, now, work out with numbers that we earlier used for evaluating greatest integer function :
{ 0.23 } = 0.23 [ 0.23 ] = 0.23 0 = 0.23 { 0.23 } = 0.23 [ 0.23 ] = 0.23 0 = 0.23
{ 1.7 } = 1.7 [ 1.7 ] = 1.7 1 = 0.7 { 1.7 } = 1.7 [ 1.7 ] = 1.7 1 = 0.7
{ - 0.54 } = - 0.54 [ - 0.54 ] = - .54 - 1 = - 0.54 + 1.0 = 0.36 { - 0.54 } = - 0.54 [ - 0.54 ] = - .54 - 1 = - 0.54 + 1.0 = 0.36
{ - 2.34 } = - 2.34 [ - 2.34 ] = - 2.34 - 3 = - 2.34 + 3.0 = 0.66 { - 2.34 } = - 2.34 [ - 2.34 ] = - 2.34 - 3 = - 2.34 + 3.0 = 0.66
We can see that interpretation of fraction for the negative number is consistent with what has been explained earlier.

Graph of {x}

Few function expressions in different intervals are :
For - 2 x < - 1, f x = { x } = x [ x ] = x 2 = x + 2 For - 2 x < - 1, f x = { x } = x [ x ] = x 2 = x + 2
For - 1 x < 0, f x = { x } = x [ x ] = x - 1 = x + 1 For - 1 x < 0, f x = { x } = x [ x ] = x - 1 = x + 1
For 0 x < 1, f x = { x } = x [ x ] = x 0 = x For 0 x < 1, f x = { x } = x [ x ] = x 0 = x
For 1 x < 2, f x = { x } = x [ x ] = x 1 For 1 x < 2, f x = { x } = x [ x ] = x 1
For 2 x < 3, f x = { x } = x - [ x ] = x - 2 For 2 x < 3, f x = { x } = x - [ x ] = x - 2
The graph of the function is shown here :
Graph of {x} function
fc2.gif
Figure 2: The domain of the function is R.
We see that there is no restriction on values of x and as such its domain has the interval equal to that of real numbers. The fractional part function can only evaluate to non-negative values between 0≤y<1. Hence,
Domain = R Domain = R
Range = 0 y < 1 Range = 0 y < 1

Least integer function

We have seen that greatest integer function represents the integer, which can be considered to be the floor integral value of a real number. Correspondingly, we define a ceiling function called “least integer function”, which returns the least integer greater than or equal to the number (x). We denote least integer function as “[x)” and interpret it as :
  • [x) = least integer greater than or equal to the number (x)
  • [x) = least integer not less than or equal to the number (x)
Clearly, least integer function returns a value, which is the integral “ceiling” of the number. For this reason, least integer function is also known as “ceiling” function. Working rules for finding least integer function are :
  1. If “x” is an integer, then [x) = x.
  2. If “x” is not an integer, then [x) evaluates to least integer greater than “x”.
The value of f(x) is an integer (n) such that :
f x = n ; if n - 1 < x n n Z f x = n ; if n - 1 < x n n Z

Graph of least integer function

Few initial values of the functions are :
F o r - 3 < x - 2, f x = [ x ) = - 2 F o r - 3 < x - 2, f x = [ x ) = - 2
F o r - 2 < x - 1, f x = [ x ) = - 1 F o r - 2 < x - 1, f x = [ x ) = - 1
F o r 1 < x 0, f x = [ x ) = 0 F o r 1 < x 0, f x = [ x ) = 0
F o r 0 < x 1, f x = [ x ) = 1 F o r 0 < x 1, f x = [ x ) = 1
F o r 1 < x 2, f x = [ x ] = 2 F o r 1 < x 2, f x = [ x ] = 2
Graph of least integer function
fc3.gif
Figure 3: The domain of the function is R.
We see that there is no restriction on values of “x” and as such its domain has the interval equal to that of real numbers. On the other hand, the least integer function evaluates only to integer values. It means that the range of the function is set of integers, denoted by "Z". Hence,
Domain = R Domain = R
Range = Z Range = Z

Nearest integer function

Nearest integer function, as the name suggests, returns the nearest integer. It is denoted by the symbol, "(x)".
The value of "(x)" is an integer "n" such that :
f x = ( x ) = n ; if n x n + 1 / 2, n Z f x = ( x ) = n ; if n x n + 1 / 2, n Z
f x = n + 1 ; if n + 1 / 2 < x n + 1, n Z f x = n + 1 ; if n + 1 / 2 < x n + 1, n Z
Examples :
2.3 = 2, 2.6 = 3 2.3 = 2, 2.6 = 3
- 2.3 = - 2, - 2.6 = - 3 - 2.3 = - 2, - 2.6 = - 3

Comments, questions, feedback, criticisms?

Discussion forum

Send feedback