How Does Modulus Divison Work

后端 未结 19 1555
栀梦
栀梦 2020-11-22 06:55

I don\'t really understand how modulus division works. I was calculating 27 % 16 and wound up with 11 and I don\'t understand why.

I can\'t

19条回答
  •  孤街浪徒
    2020-11-22 07:10

    I hope these simple steps will help:

    20 % 3 = 2 
    
    1. 20 / 3 = 6; do not include the .6667 – just ignore it
    2. 3 * 6 = 18
    3. 20 - 18 = 2, which is the remainder of the modulo

提交回复
热议问题