Skip to content

Instantly share code, notes, and snippets.

@denysvitali
Created January 6, 2019 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denysvitali/343e3697c7bfcc2381b4583ee65ddb22 to your computer and use it in GitHub Desktop.
Save denysvitali/343e3697c7bfcc2381b4583ee65ddb22 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(){
int i = 0;
int a = 23;
int b = 3;
i += a;
i = i << 5;
i += b;
printf("%d\n", i);
int c = i & 0x1F; // == b
int d = i >> 5;
if(c != b){ printf("Errore\n"); }
if(a != d){ printf("Errore 2\n"); }
printf("%d - %d", c, d);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment