Skip to main content
ozenozkaya2
Associate
July 13, 2010
Question

CAN IEEE754 Float

  • July 13, 2010
  • 3 replies
  • 827 views
Posted on July 13, 2010 at 18:59

CAN IEEE754 Float

#ieee754 #union
    This topic has been closed for replies.

    3 replies

    stforum2
    Visitor II
    May 17, 2011
    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]);

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

    that is exactly what i did :)

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

    I think you can use union :)

    typedef union

    {

        u8      data[8];

        float   data_float[2];  

    }UIEEE754;