How does modulus of a smaller dividend and larger divisor work?

后端 未结 10 1274
误落风尘
误落风尘 2020-12-15 04:47
7 % 3 = 1 (remainder 1)

how does
3 % 7 (remainder ?)

work?

10条回答
  •  天命终不由人
    2020-12-15 05:13

    For my brain to understand this kind of question, I'm always converting it to a real world object, for example if I convert your question 3 % 7. I'm going to represent the "3" as a 3-inch wide metal hole, then the "7" as a 7 inch metal screw. Can you insert the 7 inch metal screw to a 3 inch wide metal hole? Of course not, therefore the answer should be the 3-inch metal hole, it doesn't matter even let say you have a 1000 or a million inch wide screw, it is still 3, because how many times can you insert the 1000 or a million inch wide screw to a 3 inch wide metal hole? Zero times, right?

提交回复
热议问题