I should have said everybody (and I meant the languages and silicon) is 
effectively checking "!= 0" for true.

And the !!condition is a mathematical theorem of why -1 is not a good value to 
use for "true"....not that you see that very often (if at all).  What you do 
see is "if (!condition == true)" which will fail when true is -1 and condition 
is false.





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems

________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Nico Williams [n...@cryptonector.com]
Sent: Thursday, April 19, 2012 4:47 PM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with 
entityframework

On Thu, Apr 19, 2012 at 3:51 PM, Black, Michael (IS)
<michael.bla...@ngc.com> wrote:
> You are correct that non-zero will be treated as true.
>
> That's more an accident then anything else as everybody is checking "!= 0" 
> for true.

No, C treats any non-zero value as true, as in "if (condition) ..." --
that condition will considered true if it's non-zero.

If you ever see "!!condition", that's just to normalize true values.

Nico
--
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to