Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!cartan!brahms.Berkeley.EDU!ballou From: ballou@brahms.Berkeley.EDU (Kenneth R. Ballou) Newsgroups: comp.lang.c Subject: Re: (unsigned)-1 Message-ID: <646@cartan.Berkeley.EDU> Date: Sat, 20-Dec-86 02:02:06 EST Article-I.D.: cartan.646 Posted: Sat Dec 20 02:02:06 1986 Date-Received: Sat, 20-Dec-86 07:37:12 EST References: <1382@hoptoad.uucp> <8322@lll-crg.ARpA> <2221@eagle.ukc.ac.uk> <5460@brl-smoke.ARPA> <800@nscpdc.NSC.COM> Sender: daemon@cartan.Berkeley.EDU Reply-To: ballou@brahms.Berkeley.EDU (Kenneth R. Ballou) Organization: Math Dept. UC Berkeley Lines: 46 In article <800@nscpdc.NSC.COM> djg@nscpdc.NSC.COM (Derek J. Godfrey) writes: >In article <5460@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: >[original poster?] Your attribution is incorrect. It is I who wrote that argument. >>Actually, I think (unsigned) -1 does have to give you a bit pattern of >>all 1's. > >Enough! The C language conserns itself with the syntax and semantics >of its programs, not its pragmatisms(these are the concerns of compiler >writers and hackers :-) .) I am afraid I do not understand the preceding sentence. What are 'pragmatisms' of a language? C must specify the behavior of any syntatically correct program. There are, of course, details which C leaves to the implementer and machine, but that these are not defined must be specified by the language. > Firstly "all ones" is compiler/machine dependant - solveable > if you know or can anticipate the representation > of numbers made by your compiler. > ( 2's comp -1, mostly ~0, always #define ALL1S 0x????? ) Again, might I restate that the argument makes no assumption about how *signed* integers are represented? Point 1 asserts that *unsigned* integers must be represented in straight binary notation. > Secondly but more importantly what semantics do you attribute > to "all ones?" Tell me if I am missing something, but I interpret "all ones" to be what to me is obvious: a region of memory all of whose bits are 1. > this should dictate how to represent it. ( a > collection of bits fields, a range a numbers (2^n -1 ) a > combination of masks, or whatever.) Again, I do not understand your point. Could you please offer a clarification? -------- Kenneth R. Ballou ARPA: ballou@brahms Department of Mathematics UUCP: ...!ucbvax!brahms!ballou University of California Berkeley, California 94720