Table of Contents

Bit functions

These functions are for bit math.

Powers of two

Working with bit arrays

These functions allow you to work with variables as if they were arrays of bits:

Unsetting bit flags

void notflag(int flags, int flag)

Bit flags can be applied using flags & SOMEFLAG. But removing them requires a more complicated expression !(flags & SOMEFLAG).

notflag(flags, SOMEFLAG) unsets SOMEFLAG, shorthand for !(flags & SOMEFLAG).