Why use !!(condition) instead of (condition)? [duplicate]
This question already has an answer here: What does !!(x) mean in C (esp. the Linux kernel)? 3 answers I've seen code where people have used conditional clauses with two '!'s #define check_bit(var, pos) (!!((var) & (1 << (pos)))) #define likely(x) __builtin_expect(!!(x),1) #define unlikely(x) __builtin_expect(!!(x),0) are some of the examples I could find. Is there any advantage in using !!(condition) over (condition) ? Well if the variable you are applying !! is not already a bool ( either zero or one ) then it will normalize the value to either 0 or 1 . With respect to __builtin_expect this