Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is very common in C code, where for most of its history you hadn't any explicit boolean data type but used int, following the rule that zero is false and anything else is true.

The '!!expr' is the idiom most people use whenever the need for a canonical 0/1 representation arises.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: