yes, it’s two nots.
!!a
is 1
if a
is non-zero and 0
if a
is 0
You can think of !!
as clamping, as it were, to {0,1}
. I personally find the usage a bad attempt to appear fancy.
More Related Contents:
- What is short-circuit evaluation in C?
- “&&” and “and” operator in C
- What is the "–>" operator in C/C++?
- "." or "->" C struct accessor [duplicate]
- Why the logical operators are not working as expected? [closed]
- Logic behind sizeof operator [duplicate]
- which is faster assigning a number to the variable or changing the value of that variable either by adding or subtracting some number?
- How to work with a variable number of variables in C?
- C: What is the output of the following code? And please explain [duplicate]
- What does the ??!??! operator do in C?
- What does the comma operator , do?
- What’s the difference between “mod” and “remainder”?
- Why is sizeof considered an operator?
- The ternary (conditional) operator in C
- What does i = (i, ++i, 1) + 1; do?
- Precedence of && over || [duplicate]
- Logical Operators in C
- Is relying on && short-circuiting safe in .NET?
- What does =+ mean in C?
- Logical XOR operator in C++?
- Why isn’t “k” incremented in the statement “m = ++i && ++j || ++k” when “++i&&++j” evaluates to true? [duplicate]
- What does =+ (equals-plus) mean in C?
- In C, what is the difference between `&function` and `function` when passed as arguments?
- What is ‘:-!!’ in C?
- Does *p++ increment after dereferencing? [duplicate]
- Static variable inside of a function in C
- Merge multiple .so shared libraries
- When implementing an infinite loop, is there a difference in using while(1) vs for(;;) vs goto (in C)?
- How to concatenate string and int in C?
- QuickSort and Hoare Partition