title: Kotlin long literal: The value is out of range
body: <p>bit mask <code>0xaaaaaaaaaaaaaaaaL</code> (16a's) is out or range in kotlin. If I have Android Sutdio automatically convert from Java, it translate to <code>-0x5555555555555556L</code>, which is <code>101010101010101010101010101010101010101010101010101010101010110</code>, it is now only 63 bit and 0110 at the end is off.</p>
  <p><code>0xaaaaaaaaaaaaaaaaL</code> works well in Java. I need an explanation of why it becomes <code>-0x5555555555555556L</code> 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?</p>
  <p>I looked at the doc <a href="https://kotlinlang.org/docs/basic-types.html#literal-constants" rel="nofollow noreferrer">https://kotlinlang.org/docs/basic-types.html#literal-constants</a>, I know kotlin support Hexadecimals syntax.</p>
  <p>I also tried Unsigned Long <code>val mask2: ULong = 0xaaaaaaaaaaaaaaaaL</code> same problem.</p>
  <p>Thanks in advance</p>