Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: comp.lang.c Subject: Re: bit patterns of all ones Message-ID: <1527@hoptoad.uucp> Date: Fri, 19-Dec-86 05:20:44 EST Article-I.D.: hoptoad.1527 Posted: Fri Dec 19 05:20:44 1986 Date-Received: Fri, 19-Dec-86 22:59:33 EST References: <1382@hoptoad.uucp> <690001@hplsla.HP.COM> Organization: Nebula Consultants in San Francisco Lines: 18 Ken Ballou seems to have presented good and valid reasons derived from H&S that (unsigned)-1 must have all the bits on. So far nobody has refuted him. I think he's right -- the cast to unsigned *must*, by the C language definition, convert whatever bit pattern -1 has into all ones. This is no worse than casting -1 to float causing a change its bit pattern -- and it's for the same reason. I think it's funny that Ben Mejia's message says that a word containing all ones in ones complement machines is "an illegal representation" but then goes on to tell us that such an illegal value is easily and portably generated with ~0. The value does not know how it was generated, Ben; why is it illegal to get all ones with cast and a -, but legal to do it with ~? And what legislature is passing laws about bit patterns? Invalid values I can see, but are they going to arrest me for contraband bit patterns? -- John Gilmore {sun,ptsfa,lll-crg,ihnp4}!hoptoad!gnu jgilmore@lll-crg.arpa Call +1 800 854 7179 or +1 714 540 9870 and order X3.159-198x (ANSI C) for $65. Then spend two weeks reading it and weeping. THEN send in formal comments!