bit mask 0xaaaaaaaaaaaaaaaaL (16a's) is out or range in kotlin. If I have Android Sutdio automatically convert from Java, it translate to -0x5555555555555556L, which is 101010101010101010101010101010101010101010101010101010101010110, it is now only 63 bit and 0110 at the end is off.
0xaaaaaaaaaaaaaaaaL works well in Java. I need an explanation of why it becomes -0x5555555555555556L in kotlin.
Another question is how does kotlin represent negative Long? Why the - sign in the front? It is not 2's complement like in Java?
I looked at the doc https://kotlinlang.org/docs/basic-types.html#literal-constants, I know kotlin support Hexadecimals syntax.
I also tried Unsigned Long val mask2: ULong = 0xaaaaaaaaaaaaaaaaL same problem.
Thanks in advance