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

Doing bit manipulations in Kotlin

Kotlin provides several functions (in infix form) to perform bitwise and bit shift operations. In this section, we will learn to perform bit-level operation in Kotlin with the help of examples.

Bitwise and bit shift operators are used on only two integral types—Int and Long—to perform bit-level operations.