This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Conversion of float to unsigned char

Hello every one,

I am using cc430f5137, i want to convert my float variable into four bytes of character array. Like

float a = 0.135 into hex 0x3E0A3D71

char b[4] ;

now i want to shift this value like that;

char b[0] = 3E
char b[1] = 0A
char b[2] = 3D
char b[3] = 71

i want to know that how i can shift these values like that.

Also i want to ask that if any one know that how  float representation in 16 bits can be done.

Thanks

Waqas

**Attention** This is a public forum