Path: utzoo!utgpu!news-server.csri.toronto.edu!dgp.toronto.edu!flaps Newsgroups: comp.lang.c From: flaps@dgp.toronto.edu (Alan J Rosenthal) Subject: Re: FALSE and TRUE, (FALSE = -1 ?) Message-ID: <1990Sep11.121134.23027@jarvis.csri.toronto.edu> References: <3032@bruce.cs.monash.OZ.AE> Date: 11 Sep 90 16:11:34 GMT Lines: 12 alanf@bruce.cs.monash.OZ.AE (Alan Grant Finlay) writes: >I prefer to use -1 to represent [true] in C. Assuming you don't modify the compiler, you can't do this consistently as boolean relations will still return 1. >Since you can't have a one bit two's complement integer I should probably >use ~0. Bad choice, as this will probably count as false on ones complement systems. (It might not if the compiler can guarantee not to generate you any minus- zeroes with any operators it provides you.)