Bitwise operators don't work with floating point types. Really the best you can do is pun the float into an unsigned char pointer and perform the operation on that. However, this could easily produce results that you're not expecting or that are completely erroneous given the structure of floating point values in binary.

Since floats are 32-bit values, you could pun them to an unsigned 32-bit integer, do the bit-wise operations, and then cast it back to a float. The rest of what decepticon said is correct. If you don't know PRECISELY how the float is represented in the specific bits of the 32-bit word (mantissa, exponent, sign, etc), then you cannot know how the operation will alter the value, including turning it into an invalid value (NAN), resulting in a floating point exception in your program as soon as you try to do anything with it as a floating point number.

Th is is a sample code. What is really happening :
- client node reads in light sensor data from sensor . Puts data in packet and sends to server
- server receives packets. Adds it to buf and does some math on them to display the data properly.

Take tv as the received data from part of buffer. The code checks if the content is negative value (starting with 0xFxxx) and if it isn't then convert data content into percentage and display.