Kotlin Programming Cookbook
上QQ阅读APP看书,第一时间看更新

Getting ready

Here's the complete list of bitwise operations (available for Int and Long only):

  • shr(bits): signed shift right (Java's >>)
  • ushr(bits): unsigned shift right (Java's >>>)
  • and(bits): bitwise and
  • or(bits): bitwise or
  • xor(bits): bitwise xor
  • inv(): bitwise inversion