Obtaining the byte values in a float or double.


/ Published in: C
Save to your folder(s)

This routine can be used to copy the byte values of a float or double. The "isBigEndian" variable needs to be determined (most PCs are little-endian, whereas most embedded microprocessors are big-endian). Instead of using unsigned chars, it can be useful to do a "typedef unsigned char UINT8" and simply use UINT8 as the variable type.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.