Remainder - The Case of General Integers

The Case of General Integers

If a and d are integers, with d non-zero, then a remainder is an integer r such that a = qd + r for some integer q, and with |r| < |d|.

When defined this way, there are two possible remainders. For example, the division of −42 by −5 can be expressed as either

−42 = 9×(−5) + 3

as is usual for mathematicians, or

−42 = 8×(−5) + (−2).

So the remainder is then either 3 or −2.

This ambiguity in the value of the remainder can be quite serious computationally; for mission critical computing systems, the wrong choice can lead to dangerous consequences. In the case above, the negative remainder is obtained from the positive one just by subtracting 5, which is d. This holds in general. When dividing by d, if the positive remainder is r1, and the negative one is r2, then

r1 = r2 + d.

Read more about this topic:  Remainder

Famous quotes containing the words case and/or general:

    Socialists make the mistake of confusing individual worth with success. They believe you cannot allow people to succeed in case those who fail feel worthless.
    Kenneth Baker (b. 1934)

    Then comes my fit again. I had else been perfect,
    Whole as the marble, founded as the rock,
    As broad and general as the casing air.
    But now I am cabined, cribbed, confined, bound in
    To saucy doubts and fears.
    William Shakespeare (1564–1616)