Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!bu-cs!mit-eddie!genrad!decvax!tektronix!reed!nscpdc!djg From: djg@nscpdc.NSC.COM (Derek J. Godfrey) Newsgroups: comp.lang.c Subject: Re: (unsigned)-1 Message-ID: <800@nscpdc.NSC.COM> Date: Thu, 18-Dec-86 23:53:45 EST Article-I.D.: nscpdc.800 Posted: Thu Dec 18 23:53:45 1986 Date-Received: Sat, 20-Dec-86 06:17:33 EST References: <1382@hoptoad.uucp> <8322@lll-crg.ARpA> <2221@eagle.ukc.ac.uk> <5460@brl-smoke.ARPA> Organization: National Semiconductor, Portland Development Center, Portland, OR Lines: 16 Summary: 1-1-1-1 In article <5460@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: [original poster?] >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 :-) .) 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????? ) Secondly but more importantly what semantics do you attribute to "all ones?" 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.)