1. 2 is not a logical value. It is an integer value.
2. AFAIK, !0 is defined no stricter than 'non-zero' in all programming languages that allow implicit cross-casting between integer and boolean types. Thus, between different compilers !!2 == !(0) != 0. You can make no assertion about the actual value of !0.
3. This is not a claim. This is wordplay, and wordplay is only clever, not useful or truthful.
Discussion (8)
Note the priority of operations and the programming tag.
This is true.
But, how the false and the truth can be added? :)
They can because of programming tag :P
Type mismatch error.
Claims inspired by this comment
!!2 !== !!0+1What evil language do you use?
String typization sux!
"order of operations" depends on the language, and you haven't specified one.
Hmm… that’s true…
However (!!2 == !!0+1) is true for most of them.
i.e. C (and C++), pike, perl, and probably many others…
1. 2 is not a logical value. It is an integer value.
2. AFAIK, !0 is defined no stricter than 'non-zero' in all programming languages that allow implicit cross-casting between integer and boolean types. Thus, between different compilers !!2 == !(0) != 0. You can make no assertion about the actual value of !0.
3. This is not a claim. This is wordplay, and wordplay is only clever, not useful or truthful.