I found the following bit of code on a this MSDN page.
(((Width * Planes * BitCount + 31) & ~31) / 8) * abs(Height)
This does indeed compile in C# visual studio 2010. What exactly is the tilde "~" doing in front of the number 31? I’ve never seen this syntax in an expression before.
That is the bitwise complement operator, also known as bitwise negation.