From: cix Date: 2002-02-05T08:45:42+09:00 Subject: Re: Division Modulo Problem Integers are very confusing, aren't them? ;-) > 9 / 2 = 4 that is easy A 9/2 = 4.5 => 4 (lower end) as integer B > -9 / 2 = -5 ??? => -5 (lower end) like A infact -9 / 2 = -4.5 => -5 (lower end) like A C > 9 / -2 = -5 ??? that is because -9/2 = 9/-2 D > 9 % 2 = 1 OK 1 = 9 - 2* 4 E > -9 % 2 = 1 ??? if -9 / 2 = -5 then 1 = -9 - 2*(-5) like D F > 9 % -2 = -1 ??? -1 = 9 - (-2) *(-5) like D