CAN IEEE754 Float
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2010-07-13 9:59 AM
Posted on July 13, 2010 at 18:59
CAN IEEE754 Float
#ieee754 #union
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:58 AM
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]);Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:58 AM
Posted on May 17, 2011 at 13:58
I think you can use union :)
typedef union { u8 data[8]; float data_float[2]; }UIEEE754;Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:58 AM
Posted on May 17, 2011 at 13:58
that is exactly what i did :)
