Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!shelby!agate!ucbvax!ETSUACAD.BITNET!S47852EF From: S47852EF@ETSUACAD.BITNET ("Frank C. Earl") Newsgroups: comp.lang.forth Subject: Re: Modulus Message-ID: <9103011824.AA19103@ucbvax.Berkeley.EDU> Date: 28 Feb 91 21:21:17 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: "Frank C. Earl" Organization: The Internet Lines: 58 On Wed, 27 Feb 91 15:46:01 PST Mitch Bradley said: > >Sorry, this isn't correct. The mathematical definition of signed >integer division with remainder is the following equation holds: > > quotient*divisor + remainder = dividend > But it *is* correct- a fractional representation is simply what you just said From what I was told from 1st and second grade on, a fraction is the same thing a division operation and that integer division returns the whole number result and the divisor of the left over fraction, or in other words- 4 1 - = 4 / 3 = 1.33333 which is approximately equal to 1 + - . 3 3 I get the SAME results from a calculator- ANY calculator. Also, all the calculators in my house give me the *SAME* result for -4 /-3. If, I'm wrong, then ALL the calculators we use are also wrong... (I don't think anybody wants to touch that w/ a 10-ft pole... :) >There are other choices, but the Forth-83 choice is definitely mathematically >correct, and there is considerable evidence to suggest that it is the >best choice for many if not most numerical applications. Robert Berkey >has written extensively on this topic, and rather than recap his arguments, >I refer interested readers to the literature. > >Following up on the example presented, let's recast it in fractional form: > > remainder dividend > quotient + --------- = -------- > divisor divisor > > -1 -4 > 1 + --------- = -------- > -3 -3 > >Thus we see that the error in the original argument stems from the fact >that, which the signs of the dividend and divisor cancel out, the >fractional representation implies that the remainder is also divided >by the divisor. In order for the divisor's sign to be canceled in the >remainder term, the remainder must be negative. > >Mitch Your example didn't come ove the net well at all... Please re-post it if you'd like. It really doesn't show any errors in my reasoning at all in the form that I got... BTW- One of my grad instructors has checked my reasoning and he agrees; this coming from a math instructor, has me thinking that something's awry... Thanks, Frank