Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!samsung!emory!emcard!stiatl!srchtec!johnb From: johnb@srchtec.UUCP (John Baldwin) Newsgroups: comp.lang.c Subject: Re: TRUE and FALSE Message-ID: <191@srchtec.UUCP> Date: 31 Aug 90 21:19:59 GMT References: <514@demott.COM> <2316@cirrusl.UUCP> <3835@sactoh0.SAC.CA.US> Organization: search technology, inc. Lines: 28 In article <3835@sactoh0.SAC.CA.US> jak@sactoh0.SAC.CA.US (Jay A. Konigsberg) writes: > >Personally though, I like the following: > >#define TRUE -1 > >Why? Because of the following 8 bit pattern: > > 1: 01111111 >-1: 11111111 Aaaiigh! Never... NEVERNEVERNEVERNEVER *ever* assume 1's-complement, 2's-complement, and so on! The exception to this is when writing very machine-specific code which you already *know* isn't going to be portable anyway. Even then, there are some tricks to isolate yourself from the architecture, without giving up much. P.S. what architecture gives 1(decimal) == 01111111 (binary) ??? -- John T. Baldwin | johnb%srchtec.uucp@mathcs.emory.edu Search Technology, Inc. | | "... I had an infinite loop, My opinions; not my employers'. | but it was only for a little while..."