Important: The information in this document is obsolete and should not be used for new development.
Efficient Type Declarations
MathLib contains two floating-point type definitions,float_t
anddouble_t
in the headerTypes.h
. If you define a variable to befloat_t
ordouble_t
, it means "use the most efficient floating-point format for this architecture." Table 7-2 shows the definitions forfloat_t
anddouble_t
for both the PowerPC and 680x0 architecture.
Table 7-2 float_t
anddouble_t
typesArchitecture float_t
typedouble_t
typePowerPC float double 680x0 long double long double For the PowerPC architecture, the most natural format for computations is double, but the architecture allows computations in single precision as well. Therefore, for the PowerPC architecture,
float_t
is defined to befloat
(single precision) anddouble_t
is defined to bedouble
. The 680x0 architecture is based on an 80-bit double-extended format (known as extended) and performs all computations in this format regardless of the type of the operands. Therefore,float_t
anddouble_t
are bothlong double
(extended precision) for the 680x0 architecture.If you declare a variable to be type
double_t
and you compile the program as a PowerPC application, the variable is of typedouble
. If you recompile the same program as an 680x0 application, the variable is of typelong double
.