Skip to content

Instantly share code, notes, and snippets.

@fabiomsr
Last active August 1, 2016 17:23
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 fabiomsr/6cc2ccd9f5035c355317c9dde522a157 to your computer and use it in GitHub Desktop.
Save fabiomsr/6cc2ccd9f5035c355317c9dde522a157 to your computer and use it in GitHub Desktop.
// Java
final int andResult = a & b;
final int orResult = a | b;
final int xorResult = a ^ b;
final int rightShift = a >> 2;
final int leftShift = a << 2;
// Kotlin
val andResult = a and b
val orResult = a or b
val xorResult = a xor b
val rightShift = a shr 2
val leftShift = a shl 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment