Article ID: 129209 - Last Review: July 5, 2005 - Revision: 1.2 How To Convert 10-Byte Long Doubles to 8-Byte DoublesThis article was previously published under Q129209 On This PageSUMMARY
With the 16-bit Microsoft C/C++ compilers, long doubles are stored as 80-
bit (10-byte) data types. Under Windows NT, in order to be compatible with
other non-Intel floating point implementations, the 80-bit long double
format is aliased to the 64-bit (8-byte) double format.
This means that 32-bit programs may not be able read back data files written by 16-bit programs because the long double formats are incompatible. On Intel platforms, the only workaround is to let the floating point processor handle the conversion from 80-bit to 64-bit doubles. Afterwards, the data can be stored back into a 64-bit double for use under Win32. The sample code below illustrates how you could use floating point instructions in inline assembly to convert from a 10-byte double in a data file to an 8-byte double. Sample CodeAPPLIES TO
| Article Translations
|

Back to the top
