+ 1
What is floor division and modulo division?
4 Réponses
+ 4
This question has been asked frequently in the past. So please use search bar in the Q&A section. Then select ' most recent' and enter 'modulo' or respectively 'floor' in the search bar. Thanks!
+ 3
modulus
The modulus-function computes the remainder of a division, which is the "leftover" of an integral division.
floor
The floor-function provides the lower-bound of integral division. The upper-bound is computed by the ceil function. (Basically speaking, the floor-function cuts off all decimals).
+ 2
Floor will round the decimal down and uses the / operator in most languages I know
eg.
5 / 2 = 2 no decimal after the 2
Modulo division returns the remainder and uses the % operator
5 % 2 = 1
+ 1
Thank you very much.