Post by f***@gmail.comThe floating point formats have been standardized since IEE1985.
Not sufficiently for how you want to use them.
Post by f***@gmail.comAny system that does not adhere to IEEE1985 is inviting serious
repercussions and deserves no mercy.
Endianness is still an issue for floating-point binary representations,
even if both machines conform to IEEE 754-1985.
"long double" has much less standardization than "float" and "double"
(and yes, it's a floating point format also, although you probably
don't want to use it as a transfer format between machines, as
there are many more problems than with "float" and "double").
IEEE 754-1985 does not specify what format a C compiler must use
for "long double". "long double" may be bit-for-bit identical to
"double" (e.g. on Windows Visual C++), so sizeof(long double) = 8.
Linux, the BSDs and OS X use the x86 80-bit extended format for
"long double". This takes up 10 bytes, however, sizeof(long double)
may be either 12 or 16, depending on alignment constraints. It's
conceivable that sizeof(long double) could be 10 on an 8086 for
16-bit alignment. The same bit patterns are used (modulo endianness)
but the different size of the padding will cause trouble.
IEEE 754-2008 defines some formats longer than 80 bits (128 and 256
bits) which could be used for long double.
The GNU C compiler uses a non-standard format for "long double" on
PowerPC and SPARC.