am I going insane or do Kotlin's bitwise operation...
# announcements
f
am I going insane or do Kotlin's bitwise operations behave differently than Java's?
Copy code
System.out.println((byte) -84 & 0xFF); // 172
println((-84).toByte() and (0xFF).toByte()) // -84
r
Those aren't the same. you either need to change Java to
(byte) -84 & (byte) 0xff
or Kotlin to
(-84).toByte() and 0xFF