Last active
September 25, 2016 01:53
-
-
Save dumindu/ab4e2fbe4d5c2233e103 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut a = 2; | |
a += 5; //2 + 5 = 7 | |
a -= 2; //7 - 2 = 5 | |
a *= 5; //5 * 5 = 25 | |
a /= 2; //25 / 2 = 12 not 12.5 | |
a %= 5; //12 % 5 = 2 | |
a &= 2; //10 && 10 -> 10 -> 2 | |
a |= 5; //010 || 101 -> 111 -> 7 | |
a ^= 2; //111 != 010 -> 101 -> 5 | |
a <<= 1; //'101'+'0' -> 1010 -> 10 | |
a >>= 2; //101̶0̶ -> 10 -> 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment