Skip to content

Instantly share code, notes, and snippets.

@thoward
Created January 28, 2013 01:13
Show Gist options
  • Save thoward/4651922 to your computer and use it in GitHub Desktop.
Save thoward/4651922 to your computer and use it in GitHub Desktop.
This should be true for all values of x, y, z, and w (when comparing to zero anyway)
int x=0;
int y=0;
int z=0;
int w=0;
var bitwise_or = (x | y | z | w) == 0;
var equality = x == 0 && y == 0 && z == 0 && w == 0;
System.Diagnostics.Debug.Assert(bitwise_or == equality);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment