Path: utzoo!utgpu!water!watmath!clyde!burl!codas!ufcsv!gatech!bbn!bbn.com!rsalz From: rsalz@bbn.com (Rich Salz) Newsgroups: comp.lang.c Subject: Re: "logical" xor Summary: A relop B returns 0 or 1 Message-ID: <295@fig.bbn.com> Date: 14 Jan 88 01:00:49 GMT References: <2946@zeus.TEK.COM> <170@illusion.UUCP> <39a83409.ae48@apollo.uucp> Organization: BBN Laboratories, Cambridge MA Lines: 23 >Not even true yet. All (a != 0) is guaranteed to generate (if a is >not 0) is a non-zero value ... Nope. 8/3/87 draft, page 43, lines 43-45 Each of the operators [ < > >= ] shall yield 1 if the specified relation is true and 0 if it is false. ...page 44, lines 15-16 [ == and != ] are analogous to the relational operators except for their lower precedence. K&R, in the first sentence of the last paragraph on page 189 and in the first paragraph of page 190 say almost the exact same thing. In short, doing thinks like #define TRUE (1 == 1) #define FALSE (1 == 0) if ((a == b) == TRUE) ... Is silly, and often a sign that the writer is confusing the interpretation within conditionals with the result of relationals. :-) /r$ -- For comp.sources.unix stuff, mail to sources@uunet.uu.net.