title: Java overflow have different result when calculating on a calculator to the IDE result?
body: <p>I don't understand where I am going wrong with the calculation I did, why did I receive a different result to the IDE console. Console receives a result of <code>14464</code> for the <code>println</code> for my <code>ShortTotal</code>. But via manual calculation on a calculator I received a similar number but <code>+1</code> which was <code>14465</code>?</p>
  
  <p>I understand what the short type maximum and minimum values are. Here is what I have done so far:</p>
  
  <p>As the short maximum value is around <code>32,767</code>. So it goes to the minimum again with the remaining amount. So on a calculator, you can check this by doing: 
  <code>1000 x (bytevalue+shortvalue + intvalue) = 80000</code>. As <code>80,000</code> is bigger than short max val it overflows with the remainder. <code>80,000-32767 =47233</code> then add this value back onto minimum which is :  <code>- 32768 + 47233 = 14465</code> </p>
  
  <p>I managed to get close to the value of <code>14464</code> but don't know why I'm receiving <code>14465</code>?</p>
  
  <pre><code>package com.company;
  
  public class Main {
  
      public static void main(String[] args) {
     byte ByteValue = 10;
     short ShortValue = 20;
     int IntValue = 50;
     long LongTotal = 50000 + 10 * (ByteValue + ShortValue + IntValue);
          System.out.println(LongTotal);
  //The issue in question is below.
          short ShortTotal = (short) (1000 * (ByteValue + ShortValue + IntValue));
        System.out.println(ShortTotal);
      }
  }
  </code></pre>