The Kotlin supports bitwise operators:
fun main(args: Array<String>) { val leftShift = 1 shl 2 val rightShift = 1 shr 2 val unsignedRightShift = 1 ushr 2 val and = 1 and 0x00001111 val or = 1 or 0x00001111 val xor = 1 xor 0x00001111 val inv = 1.inv() //from w ww.j a va 2 s . co m println(and) println(or) println(xor) println(inv) }
inverse is not a binary operator, so is invoked using the dot syntax on a number.