title: Java calculator, how to handle negative numbers
body: <p>I am creating a calculator in Java, and am struggling to come up with a way to handle negative numbers, so far i can parse an expression, for example this:</p>
  
  <pre><code>((4-3)*(4/2))*2
  </code></pre>
  
  <p>becomes:</p>
  
  <pre><code>[4.0, -3.0, +, 4.0, 2.0, /, *, 2.0, *]
  </code></pre>
  
  <p>However i don't know how i would deal with expressions containing negatives, such as:</p>
  
  <pre><code>2*(-2-3)
  </code></pre>
  
  <p>So far i have it so when a negative value is encountered it multiplies the number ahead of it by -1 and adds a + to the end of the list, so the expression becomes this:</p>
  
  <pre><code>[2.0, -2.0, -3.0, +, +, *]
  </code></pre>
  
  <p>This is causing many errors in my program, can anyone help with a better method to deal with negatives.</p>
  
  <p>Thanks very much for any help</p>