Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.lang.c Subject: Re: Efficient coding considered harmful? Message-ID: <341@auspex.UUCP> Date: 28 Oct 88 16:15:39 GMT Article-I.D.: auspex.341 References: <3105@hubcap.UUCP> <34112@XAIT.XEROX.COM> <1700@dataio.Data-IO.COM> <8630@smoke.ARPA> <1704@dataio.Data-IO.COM> <119@twwells.uu Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 12 >: o Use the ^ operator because many times, >: a = !a; >: should really be, >: a ^= 1; > >However, some machines can't do ^ very well, so take care. And some code for reasons of, well, *microefficiency* may rely on the fact that any non-zero value, not just 1, is considered "true" by C; the only safe way of inverting such a boolean is with "a = !a". Too bad C doesn't have a Boolean type....