ChaseDream

标题: 鼠穴机经 [打印本页]

作者: mirandachen    时间: 2012-1-13 02:05
标题: 鼠穴机经
数学记得一道-100除以30余几,答案有0,10,-10。。。答案-10
作者: dajdaj    时间: 2012-1-13 02:07
余数没有负数吧
作者: justabeginning    时间: 2012-1-13 02:27
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
作者: gentlemoon    时间: 2012-1-13 04:30
楼主,这道题我做了,答案应该是20
作者: anjjule    时间: 2012-1-13 14:01
楼上你是怎么算的? 我算出来也是-10

30x(-3)+(-10)=-100
作者: dajdaj    时间: 2012-1-13 14:03
-100=30*(-4)+20
作者: 风信子hbl    时间: 2012-1-13 14:16
我也考了这题了,确定答案是20~~题目中说了余数大于等于0的
作者: anjjule    时间: 2012-1-13 14:22
got it,谢谢楼上2位




欢迎光临 ChaseDream (https://forum.chasedream.com/) Powered by Discuz! X3.3