From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 16 Dec 2005 08:13:02 -0500 From: Dan Cross To: erik quanstrom , Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] More Microsoft bashing Message-ID: <20051216131302.GF15067@augusta.math.psu.edu> References: <6e35c0620512152004n37c06ff5wd250424db50d874d@mail.gmail.com> <20051216045115.GC15067@augusta.math.psu.edu> <20051216050214.GD15067@augusta.math.psu.edu> <20051216053346.F1BC41B12F7@dexter-peak.quanstro.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051216053346.F1BC41B12F7@dexter-peak.quanstro.net> User-Agent: Mutt/1.4.1i Cc: Topicbox-Message-UUID: c9386bb4-ead0-11e9-9d60-3106f5b1d025 On Thu, Dec 15, 2005 at 11:33:46PM -0600, erik quanstrom wrote: > you've got to take you're math cap off, and put your cs cap on. This has nothing to do with it. You're looking for a single definitive definition of something that has no single definitive definition. > the motivation for defining MOD and DIV is so you can do somethign > like this > > row = size DIV columns > col = size MOD columns Well, one would hope so! But then you have to wonder why `size' would have occasion to be negative in such an example. And even if it was, why you couldn't work with absolute values and keep track of the signs yourself. Like what Bruce said. > the pseudo-mathematics is applied ex post facto. clearly you have to > get a single value out of the operation but that value is never going to > be a member of Z. it's going to be a n-bit binary integer. also, n-bit binary *integers* are members of Z (where Z is the set of all integers: their representation doesn't matter). But that's beside the point. In either case, you will get a single value back. The question is whether that value represents a congruence class or a single integer. If you restrict your domain to non-negative integers, in this context, it doesn't matter; you get something that's more or less the same thing for your purposes. If you allow negative integers, that's when the differences become significant. As Bruce said, I think it best to avoid the situation. > ; cat > /tmp/fu.c > int main(void){ > int x; > > x = 1 % 0; > } > /tmp/fu.c: In function `main': > /tmp/fu.c:4: warning: division by zero Well, at least one compiler is sane. - Dan C.