Recording/Reading C doubles in the IEEE 754 interchange format
- by rampion
So I'm serializing a C data structure for cross-platform use, and I want to make sure I'm recording my floating point numbers in a cross-platform manner.
I had been planning on just doing
char * pos;
/*...*/
*((double*) pos) = dataStructureInstance->fieldWithOfTypeDouble;
pos += sizeof(double);
But I wasn't sure that the bytes would be…