Go Language Spec
2 min read
Integer operators
Today we continue our discussion of arithmetic operators, with a topic that is likely not new to you at all: Integer operators. Integer operators For two integer values x and y, the integer quotient q = x / y and remainder r = x % y satisfy the following relationships: x = q*y + r and |r| < |y| This should be pretty obvious and intuitive… If you divide x / y and get a quotiont q and remainder r, then multiplying q * y and adding r should reveal x again.