cancel
Showing results for 
Search instead for 
Did you mean: 

CAN IEEE754 Float

ozenozkaya2
Associate II
Posted on July 13, 2010 at 18:59

CAN IEEE754 Float

#ieee754 #union
3 REPLIES 3
stforum2
Associate II
Posted on May 17, 2011 at 13:58

At a guess, something like this:

unsigned char data[8];

float f1 = *((float*)&data[0]);

float f2 = *((float*)&data[4]);

ersoz
Associate II
Posted on May 17, 2011 at 13:58

I think you can use union :)

typedef union

{

    u8      data[8];

    float   data_float[2];  

}UIEEE754;

ozenozkaya2
Associate II
Posted on May 17, 2011 at 13:58

that is exactly what i did :)