title: Converting two bytes into 16 bit signed number
body: <p>I got two bytes: </p>
  
  <p><code>byte[0]</code> is 0000 0000</p>
  
  <p><code>byte[1]</code> is 1000 0000</p>
  
  <p>I would like to put them together and make one float value of them. So the result should be 128 is decimal and 0000 0000 1000 0000 in binary. Not negative because of the leading zero. </p>
  
  <p>My solution so far is this approach: </p>
  
  <pre><code>float f = (bytes[0] &lt;&lt; 8 | bytes[1]);
  </code></pre>
  
  <p>But this will result in a value of minus 128 for value f. It's because of the 2s complement i guess. Therefore <code>byte[1]</code> will be interpreted as negative. How can I just see the leading bit of <code>byte[0]</code> as the bit for negative/positive? </p>