Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!uw-beaver!uw-june!pardo From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.lang.c Subject: Re: "logical" xor Message-ID: <4026@june.cs.washington.edu> Date: 21 Jan 88 00:03:26 GMT References: <2946@zeus.TEK.COM> <170@illusion.UUCP> <39a83409.ae48@apollo.uucp> Reply-To: pardo@uw-june.UUCP (David Keppel) Distribution: comp.lang.c Organization: Apollo Computer, Chelmsford, MA Lines: 18 ( From: Ken Arnold ) <3986@uw-june.cs.washington.edu> pardo@uw-june.UUCP (David Keppel) writes: > >[Ken Arnold says: (a != b) could evaluate to 7 ] > >Unless this has been changed from K&R in ANSI, (a != b) must evaluate to 0 >or 1. Check K&R Appendix A, Sections 7.6, 7.7, 7.11, 7.12. Relational, >equality, and logical AND and OR are guaranteed by this section to return >only 0 and 1. > > ;-D on (And it isn't even my copy of K&R!) Pardo Pardon me. I should have been clearer. I have *used* compilers where this was the case. It is not K&R; I was picking a real-world nit, not an ansii nit, and should have said so clearly. My mistake. Ken Arnold