Is there a header that provides types similar to uint64_t for floats and doubles on Linux or gcc?

I'm wondering if there is a header that provides types similar to those uint64_t

for float and double in Linux or gcc?


source to share

2 answers

While C has no IEEE-754 floating point mandate, for all intents and purposes, it is as versatile as 2's complement arithmetic.

Under this assumption, the header <float.h>

contains the definitions of the macros: FLT_MANT_DIG


is the number of bits in the mantissa. The value (24) denotes a 32-bit, IEEE-754 single-point floating point type. The value (53) means double-precision 64-bit type.

Note, however, that the types "float" and "double" can be the same, even with a matching IEEE-754 implementation. "long double" types are often aliases for "double" types on many platforms.



"float" and "double" will usually suffice. They map to 32-bit and 64-bit types on every system I've ever used, regardless of the platform's native word size.



All Articles