title: converting negative float numbers to unsigned int
body: <p>Im trying to send a unsigned int data from a C server to a python client. The requirement is to send a negative float value to the client. currently the number is -5.700 and I have 2 problems.
  1) I dont have a clue on how to retain the negativeness within uint32_t, im using the MSB as a flag bit to get around it. Is this fine? Does anyone has better suggestions?</p>
  
  <p>2) I tried typecasting float 5.700 to uint32_t, i.e 
      <code>uint32_t fops = *(uint32_t*)(&amp;float_var) //float_var is 5.700</code>
   And fops was assigned value 0x00..40b66666 which is being sent to the python client. now how do I retrieve  the float back from this value at the client?</p>
  
  <p>update: As Mats suggested python struct unpacks -ve floats perfectly so there is no need to use a flag bit.</p>