title: Why kotlin wrong: val minT: Long = -9223372036854775808L //Long.MIN_VALUE
body: <p>Kotlin's Long.MIN_VALUE == -9223372036854775808, but when I write:</p>
  
  <p><code>val minT: Long = -9223372036854775808L //Long.MIN_VALUE</code></p>
  
  <p>IDEA say it was wrong.</p>
  
  <p>Dmitry Jemerov told me this because the <code>-</code> sign in Kotlin is not part of the constant but rather the unary minus operator applied to the constant value, and 9223372036854775808L is one larger than the maximum possible positive value for the Long type.</p>
  
  <p>But now, why Int is right :</p>
  
  <p><code>val minI: Int = -2147483648 //Int.MIN_VALUE</code></p>
  
  <p>Look here:</p>
  
  <p><a href="https://i.stack.imgur.com/UYouo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UYouo.png" alt="enter image description here"></a></p>