Navigation
 Topics Register • News • History • How to • Sequences statistics • Template prototypes

# Floor function

Jump to: navigation, search

In mathematics and computer science, the floor function is the function that takes as input a real number $\displaystyle{ x }$ and gives as output the greatest integer less than or equal to $\displaystyle{ x }$, denoted $\displaystyle{ \operatorname{floor}(x) = \lfloor x\rfloor }$.

Similarly, the ceiling function maps $\displaystyle{ x }$ to the least integer greater than or equal to $\displaystyle{ x }$, denoted $\displaystyle{ \operatorname{ceil}(x) = \lceil x \rceil }$.

### Examples

x Floor $\displaystyle{ \lfloor x\rfloor }$ Ceiling $\displaystyle{ \lceil x\rceil }$
2 2 2
2.4 2 3
2.9 2 3
−2.7 −3 −2
−2 −2 −2