IF Boolean_Logic = Inconsistent Then IsBug()

BlitzMax Forums/BlitzMax Programming/IF Boolean_Logic = Inconsistent Then IsBug()

Floyd:
I think you're wrong, and I found a document which backs me up:

http://72.14.209.104/search?q=cache:D6HAwQzyYDoJ:www.le.ac.uk/cc/tutorials/c/ccccif.html+C+true+%22not+equal+to+0%22&hl=en&gl=us&ct=clnk&cd=1


The reason is that in the C programming language dosen't have a concept of a Boolean variable, i.e. a type class that can be either true or false. Why bother when we can use numerical values. In C true is represented by any numeric value not equal to 0 and false is represented by 0. This fact is usually well hidden and can be ignored, but it does allow you to write

if(a != 0) just as if(a)

because if a isn't zero then this also acts as the value true.



Also this wikipedia page says:
http://72.14.209.104/search?q=cache:DK8fMsuWGZgJ:en.wikipedia.org/wiki/Boolean_datatype+C+true+false+boolean&hl=en&gl=us&ct=clnk&cd=1


In the C programming language, there is no boolean type provided in the C89 (but there is one in C99), but instead true/false values are determined by comparing a value to zero.