9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Dan Cross <cross@math.psu.edu>
To: erik quanstrom <quanstro@speakeasy.net>,
	Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] More Microsoft bashing
Date: Fri, 16 Dec 2005 08:13:02 -0500	[thread overview]
Message-ID: <20051216131302.GF15067@augusta.math.psu.edu> (raw)
In-Reply-To: <20051216053346.F1BC41B12F7@dexter-peak.quanstro.net>

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.



  parent reply	other threads:[~2005-12-16 13:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-16  4:04 Jack Johnson
2005-12-16  4:51 ` Dan Cross
2005-12-16  5:02   ` Dan Cross
2005-12-16  5:33     ` erik quanstrom
2005-12-16  5:38       ` Bruce Ellis
2005-12-16 10:46         ` Charles Forsyth
2005-12-16 13:13       ` Dan Cross [this message]
2005-12-16  4:53 ` erik quanstrom
2005-12-16  5:08   ` Dan Cross
2005-12-16  5:19     ` Brian L. Stuart
2005-12-16  5:27     ` Bruce Ellis
2005-12-16 14:19     ` Brantley Coile
2005-12-16 15:13       ` Bruce Ellis
2005-12-16 15:29         ` Russ Cox
2005-12-16 16:00           ` Bruce Ellis
2005-12-17  0:26             ` Jack Johnson
2005-12-17  3:59               ` Bruce Ellis
2005-12-16 15:33         ` Brantley Coile
2005-12-16 10:47   ` John Stalker
2005-12-16 14:25     ` Brantley Coile
2005-12-16 14:51       ` Gorka guardiola
2005-12-16 22:28     ` Victor Nazarov
2005-12-17 11:09 ` David Leimbach
2005-12-17 11:24   ` David Leimbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051216131302.GF15067@augusta.math.psu.edu \
    --to=cross@math.psu.edu \
    --cc=9fans@cse.psu.edu \
    --cc=quanstro@speakeasy.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).