Skip to content

Instantly share code, notes, and snippets.

@dodikk
Created March 4, 2015 14:44
Show Gist options
  • Save dodikk/34fa25af82ca242cc57e to your computer and use it in GitHub Desktop.
Save dodikk/34fa25af82ca242cc57e to your computer and use it in GitHub Desktop.
Double negation test
2015-03-04 16:43:36.566 [7773:1208001] Non Zero 1
2015-03-04 16:43:36.567 [7773:1208001] Non Zero 2
int value = 0b111100000000;
if (!value) {
NSLog(@"Equal to zero 1");
}
if (value) {
NSLog(@"Non Zero 1");
}
if (!!value) {
NSLog(@"Non Zero 2");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment