title: Decoding negative numbers as float from Hexidecimal string?
body: <p>I have a hexidecimal string that is number values, coming over serial from an external device. I am decoding them a block at a time using:</p>
  
  <pre><code>string tmpValue(incoming hex data, such as FE7258);
  
  int valueInt = Convert.ToInt32(tmpValue, 16);
  float XCoord = ((float)valueInt / 100);
  </code></pre>
  
  <p>I am able to check the output of XCoord against the device output, and when the numbers are positive, this works as expected. When they are negative, however, my results jump to incorrect.</p>
  
  <p>Even using this online converter:</p>
  
  <p><a href="http://www.rapidtables.com/convert/number/decimal-to-hex.htm" rel="nofollow">hex-to-decimal converter</a></p>
  
  <p>I see that when a negative number is converted and then converted back, it is no longer the same number.</p>
  
  <p>Is there a way around this? How can i deal with negative values in a hex - to - float conversion?</p>