模数除法如何工作 [英] How Does Modulus Divison Work
本文介绍了模数除法如何工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不太了解模数除法的工作原理.
我当时在计算27 % 16
并以11
结束,所以我不明白为什么.
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 seem to find an explanation in layman's terms online. Can someone elaborate on a very high level as to what's going on here?
推荐答案
The result of a modulo division is the remainder of an integer division of the given numbers.
这意味着:
27 / 16 = 1, remainder 11
=> 27 mod 16 = 11
其他示例:
30 / 3 = 10, remainder 0
=> 30 mod 3 = 0
35 / 3 = 11, remainder 2
=> 35 mod 3 = 2
这篇关于模数除法如何工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文