Why we use floor(x) function?
Answers
Answered by
0
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 }.[1]
For example, {\displaystyle \operatorname {floor} (2.4)=\lfloor 2.4\rfloor =2} and {\displaystyle \operatorname {ceil} (2.4)=\lceil 2.4\rceil =3} while {\displaystyle \lfloor 2\rfloor =\lceil 2\rceil =2}.
For example, {\displaystyle \operatorname {floor} (2.4)=\lfloor 2.4\rfloor =2} and {\displaystyle \operatorname {ceil} (2.4)=\lceil 2.4\rceil =3} while {\displaystyle \lfloor 2\rfloor =\lceil 2\rceil =2}.
Similar questions