POSIX specification:
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/float.h.html
Portability problems fixed by Gnulib:
int
to long double
in incorrect on some
platforms:
glibc 2.7 on Linux/SPARC64.
LDBL_*
macros are incorrect on some platforms:
On OpenBSD 4.0 and MirBSD 10, they are the same as the values of the
DBL_*
macros, although ‘long double’ is a larger type than
‘double’.
On FreeBSD/x86 6.4, they represent the incorrect 53-bit precision assumptions
in the compiler, not the real 64-bit precision at runtime.
On Linux/PowerPC with GCC 4.4, and on AIX 7.1 with GCC 4.2,
they don’t reflect the “double double” representation of long double
correctly.
FLT_HAS_SUBNORM
, FLT_DECIMAL_DIG
, FLT_TRUE_MIN
,
DBL_HAS_SUBNORM
, DBL_DECIMAL_DIG
, DBL_TRUE_MIN
,
LDBL_HAS_SUBNORM
, LDBL_DECIMAL_DIG
, LDBL_TRUE_MIN
,
that were added in ISO C 11, are missing on some platforms:
gcc 4.5.4, clang 7, Solaris 11.3 with Sun C.
LDBL_DECIMAL_DIG
is missing on some platforms:
MSVC 14.
FLT_TRUE_MIN
is not a float
on some platforms:
AIX 7.1 with xlc.
FLT_IS_IEC_60559
, FLT_NORM_MAX
, FLT_SNAN
,
DBL_IS_IEC_60559
, DBL_NORM_MAX
, DBL_SNAN
,
LDBL_IS_IEC_60559
, LDBL_NORM_MAX
, LDBL_SNAN
,
that were added in ISO C 23, are missing on some platforms:
gcc 14 without -std=c23
or -std=gnu23
, clang 18, musl libc 1.2.5, AIX 7.3 with xlclang, Solaris 11.3 with Sun C, MSVC 14.
Portability problems not fixed by Gnulib:
FLT_ROUNDS
is a constant expression and does not represent
the current rounding mode on some platforms:
glibc 2.11, HP-UX 11, mingw.
FLT_TRUE_MIN
is not a constant on some platforms:
FreeBSD/x86.
FLT_SNAN
, DBL_SNAN
, LDBL_SNAN
are not
constants on some platforms:
AIX 7.3 with xlclang, and all platforms which use the gnulib replacements.