|
|
|
|
|
by johnisgood
162 days ago
|
|
Keep in mind that applying the logical NOT operator twice (using `!!`) converts any integer expression into a strict boolean. Any non-zero value becomes `1`, and zero remains `0`. This is commonly used for boolean normalization
when the original expression yields a bitmask or arbitrary integer. While the same result can be written as `(x != 0)`, the `!!x` idiom is concise, widely used in low-level
C code, guarantees a result of exactly `0` or `1`, and works well in macros and constant expressions. |
|