Encyclopedia > Floor function

  Article Content

Floor function

In mathematics, the floor function is the function defined as follows: for a real number x, floor(x) is the largest integer less than or equal to x. For example, floor(2.3) = 2, floor(-2) = -2 and floor(-2.3) = -3. The floor function is also denoted by <math> [ x ] </math> or <math>\lfloor x \rfloor</math>.

We always have

<math> \lfloor x\rfloor \le x < \lfloor x + 1 \rfloor</math>
with equality on the left if and only if x is an integer. For any integer k and any real number x, we have
<math> \lfloor k+x \rfloor = k + \lfloor x\rfloor</math>
The ordinary rounding of the number x to the nearest integer can be expressed as floor(x + 0.5).

The floor function is not continuous, but it is upper semi-continuous.

A closely related mathematical function is the ceiling function, which is defined as follows: for any given real number x, ceiling(x) is the smallest integer no less than x. For example, ceiling(2.3) = 3, ceiling(2) = 2 and ceiling(-2.3) = -2. The ceiling function is also denoted by <math>\lceil x \rceil</math>. It is easy to show the following:

<math>\lceil x \rceil = - \lfloor - x \rfloor</math>
and the following:
<math>x \leq \lceil x \rceil < x + 1</math>
For any integer k, we also have the following equality:
<math>\lfloor k / 2 \rfloor + \lceil k / 2 \rceil = k</math>.

If m and n are coprime positive integers, then

<math>\sum_{i=1}^{n-1} \lfloor im / n \rfloor = (m - 1) (n - 1) / 2</math>

All Wikipedia text is available under the terms of the GNU Free Documentation License

  Search Encyclopedia

Search over one million articles, find something about almost anything!
  Featured Article

... 2nd century - 3rd century - 4th century Decades: 190s 200s 210s 220s 230s - 240s - 250s 260s 270s 280s 290s Years: 237 238 239 240 241 - 242 - 243 ...

This page was created in 35.2 ms