Fixed-size floating point types

Nothing like this exists in the C or C++ standards at present. In fact, there isn’t even a guarantee that float will be a binary floating-point format at all.

Some compilers guarantee that the float type will be the IEEE-754 32 bit binary format. Some do not. In reality, float is in fact the IEEE-754 single type on most non-embedded platforms, though the usual caveats about some compilers evaluating expressions in a wider format apply.

There is a working group discussing adding C language bindings for the 2008 revision of IEEE-754, which could consider recommending that such a typedef be added. If this were added to C, I expect the C++ standard would follow suit… eventually.

Leave a Comment