- UID
- 670284
- 在线时间
- 小时
- 注册时间
- 2011-9-9
- 最后登录
- 1970-1-1
- 主题
- 帖子
- 性别
- 保密
|
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 0 ≤ |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,[citation needed] 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. ----------------------from wikipedia |
|