Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
YOP. if a is an int (or an integral to be more precise), a&1 returns all bits cleared but the first one.
Thus it does not really "compares with 1".. except when used as a bool; for all integrals are implicitely convertible to bool in C++.
e.g.
if (a&1)
is equivalent toif (a%2!=0)
orif (a&1!=0)
orif (a&1==true)
see https://en.cppreference.com/w/cpp/types/is_integral