I had a controversy about what compilers \"think\" about this:
a = 8;
b = !!a;
So, is b == 0x01
? Is TRUE
always
You have not supplied enough information to tell whether !!a
works for your purposes or not.
You stated that you really need the result of a > 0
. However, this is not equivalent to !!a
if a
is signed and holds a negative value. If this is possible, then the answer is obviously "no".
!!a
is equivalent to a != 0
, not to a > 0
.