Skip to content

Instantly share code, notes, and snippets.

@gpetuhov
Created March 17, 2017 09:08
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 gpetuhov/536da3ef3d33deaadd236ba8cd250f81 to your computer and use it in GitHub Desktop.
Save gpetuhov/536da3ef3d33deaadd236ba8cd250f81 to your computer and use it in GitHub Desktop.
C++ Calculations
int result=(0xFF & 5 >> 1 + 1);
cout << "Result = " << result << endl;
// Result is 1
int a = 5*3;
float b = 1.5f;
b += --a/2;
cout << "Result2 = " << b << endl;
// Result is 8.5
cout << "Result3 = " << 25u - 50;
// Result is 4294967271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment