what total of 6 will get you the closest to 17, it will be 12 because if you go over 12 you will have 18 which is more that the question of 17 mod 6. You will then take 12 and minus from 17 which will give you your answer, in this case 5.
1.0833... <-- Quotient
__
12|13
12
1 <-- Remainder
1.00 <-- Remainder can be used to find decimal values
.96
.040
.036
.0040 <-- remainder of 4 starts repeating here, so the quotient is 1.083333...
Everything in column one is a multiple of 5. Everything in column 2 is a
5的倍数,1作为余数。现在抽象的部分: 你可以写
(1)作为1/5或作为十进制展开式。模运算符只返回
列,或者换一种思维方式,它返回 long 的余数
除法。你在处理模(5)。不同的模,不同的表。
想象一个哈希表。
In Computer science, Hash table uses Mod operator to store the element where A will be the values after hashing, B will be the table size and R is the number of slots or key where element is inserted.
However for negative integers the situation is less clear and depends on the language and/or the standard. For instance -5/2 can return -2 (truncated toward zero as before) but can also returns -3 (with another language).