I need to find out the exact binary representation for
doubles in a C++ project built with Platformio for an Atmega328 using the Ardurino framework. I don’t have access to the actual hardware so I can’t check it myself.
The micro does not have an FPU and is 8 bit so it’s pretty much all up to the compiler (or framework’s libraries?) – which in this case seems to be
avr-gcc, version 7.3. I’ve managed to get as far as the
avr-gcc documentation telling me that by default
double is represented the same way as a
float but does not specify what that actually is (the IEEE standard is only mentioned for an optional
So, the question is kinda twofold, really. Most importantly, I need to know what represetnation is the float in this particular case (I strongly suspect it’s IEEE 754, but could use a confirmation). And secondly, I wonder where can find this information formally, as a part of some kind of official documentation.
Source: Windows Questions C++