DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Floating point operations

Double-extended-precision

On certain implementations, the C compiler produces code that uses IEEE double-extended-precision arithmetic. On implementations that do not produce IEEE double-extended-precision arithmetic, either for intermediate or final results, all results are computed with the precision implicit in their type.

ANSI C includes a new data type called long double, which maps to the IEEE extended-precision format. Extended-precision is a wider type than double. Doubles on the Intel386(TM) microprocessor are 64 bits, long doubles are 80 bits. All arithmetic operations (+,-,*,/) work analogously. However, ANSI C does not require a long double to be wider than a double.

The C compilation system handles long double in different fashions, dependent on the implementation. For example, on Intel(TM) processors, complete support for long double is available. When you use the -Xc option to the cc command and the implementation does not produce double-extended-precision arithmetic code, the compiler treats a long double as computationally equivalent to a double. When you use the -Xt or -Xa options under these conditions, the compiler treats a long double as an error.


NOTE: Because of compatibility constraints, we recommend that you do not use long double on implementations that do not support double-extended-precision arithmetic.


Next topic: IEEE requirements
Previous topic: Single-precision floating point operations

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004