Path: utzoo!utgpu!water!watmath!clyde!rutgers!princeton!udel!burdvax!sdcrdcf!ism780c!nobody From: nobody@ism780c.UUCP (Unprivileged user) Newsgroups: comp.lang.c Subject: Re: "logical" xor Message-ID: <8617@ism780c.UUCP> Date: 15 Jan 88 23:23:02 GMT References: <2946@zeus.TEK.COM> <170@illusion.UUCP> <39a83409.ae48@apollo.uucp> Reply-To: marv@ism780.UUCP (Marvin Rubenstein) Organization: Interactive Systems Corp., Santa Monica CA Lines: 19 In article <39a83409.ae48@apollo.uucp> arnold@apollo.UUCP (Ken Arnold) writes: >In article <170@illusion.UUCP> Marcus Hall writes: >>((a != 0) ^ (b != 0)) gives (1) ^ (1) == 0, which is false. > >Not even true yet. All (a != 0) is guaranteed to generate (if a is >not 0) is a non-zero value, *any* non-zero value, which just *usually* >is 1. It could be 7. From K&R page 198 ----------------- "The operators < (less than), > (greater than) , <= (less than or equal to), and >= (greater than or equal to) all yield 0 if the specified relation is false and 1 if it is true." A simiilar statement appears on page 190 for == and !=. There is similar wording in the proposed standard but I loaned out my only copy so I cannot quote it. Marv Rubinstein -- Interactive Systems