a journal of the various projects I've got going on...

if (x & (1<<n)) { //n-th bit is set }

y = x | (1<<n)

y = x & ~(1<<n)

y = x ^ (1<<n)