Missing stdfloat.h common library?

Hi community.

This is my first post. I’m mainly working on ESP8266 and ESP32. For the ESP32 I’m using the esp-idf FREERTOS environment. I did already some test projects and now figured out that there is a stdint.h and a stdbool.h but no stdfloat.h which includes the float32_t. I’m wondering that this is not available, does someone have an explanation why?

Thanks and regards


PlatformIO just packages the toolchain released by Espressif. You should open an issue at GitHub - espressif/crosstool-NG: crosstool-NG with support for Xtensa, which is the build tool for the GCC based toolchain for esp8266 and esp32 chips.

As a workaround you can put the file

in the include/ folder of the project.

1 Like

Will do, thanks maxgerhardt

I found this post that helped me in this question.


I think the reason is that we know exactly what an int32_t is: 32 bits representing an integer value in a specific way; endianness may differ, but that’s it.

But what is a float32_t? Yes, it’s 32 bits. Now, how many of these are devoted to the mantissa and the exponent? Does the representation even use the sign-exponent-mantissa format? Are there special values for not-a-number or infinity? How are these represented?

So float32_t is a rather hazier concept than int32_t.

Nonetheless, a proposal has been submitted to both the C and the C++ standardization committees to add a new header to the Standard Libraries with typedefs just like those you are talking about.

The general feeling on the C++ end of things is that C should lead in these matters, and C++ will follow. But the C committee does not seem to be doing anything about it, as far as I can tell.