模除法是如何工作的 [英] How Does Modulus Divison Work

查看:34
本文介绍了模除法是如何工作的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不明白模数除法是如何工作的.我正在计算 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆