Where to find information about the exact binary representation of floating point values used by avr-gcc when compiling for 8-bit processors?

  avr-gcc, c++, floating-point

I need to find out the exact binary representation for floats and 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 long double).

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++

LEAVE A COMMENT