From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <775b8d190512160713u1e416e4el315f98f9d4e8227d@mail.gmail.com> Date: Sat, 17 Dec 2005 02:13:46 +1100 From: Bruce Ellis To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] More Microsoft bashing In-Reply-To: <4fe40a6eaaea00ef3c10298bb6a642c6@coraid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20051216050830.GE15067@augusta.math.psu.edu> <4fe40a6eaaea00ef3c10298bb6a642c6@coraid.com> Topicbox-Message-UUID: c952be24-ead0-11e9-9d60-3106f5b1d025 Sorry - I thought we were talking about C. Does plan9 have an Oberon environment these days? brucee On 12/17/05, Brantley Coile wrote: > 0 <=3D (x MOD y) < y or y < (x MOD y) <=3D 0 > > -- `Programming in Oberon,' M. Reiser and N. Wirth, Page 3= 6. > (which is available as a pdf from the web) > > > On Thu, Dec 15, 2005 at 10:53:06PM -0600, erik quanstrom wrote: > >> | Please note that this definition of DIV and MOD differs from the > >> | definition given in [M. Reiser, N. Wirth. Programming in Oberon. p. > >> | 36]: > >> | x =3D (x DIV y) * y + (x MOD y), and > >> | 0 <=3D (x MOD y) < y > > ^^^^^^^^^^^^^^^^^^ > >> | > >> | So, what *is* -5 MOD 3? > >> | > >> > >> -2 > > > > Are you sure? It looks to me more than it'd be +1. Wirth's definition > > above would tend to indicate that x MOD y is always positive, unless I'= m > > reading it wrong, or that's not the whole story (and I confess I'm too > > lazy to look up the definitions in context). If I'm right, that would > > also imply that x DIV y tends more wards negative infinity than zero > > for negative numerators. > > > > - Dan C. > >