3.4 ‘MOD’: THE BINARY OPERATION
The quotient of n divided by m is [n/m],when m and n are positive
integers. It’s handy to have a simple notation also for the remainder
of this division, and we call it ‘n mod m’, The basic formula
n = m[n/m]+ n mod m
//NOTE:”m[n/m]” is quotient, “n mod m” is remainder
tells us that we can express n mod m as n-m[n/m] .We can generalize this
to megative integers, and in fact to arbitrary real numbers:
x mod y = x - y[x/y], for y!=0.
在这里的余数(Remainder)其实就是取模(mod):x mod y=x % y=x-y(x/y),for y!=0.