Controls the use of special floating point instructions to improve performance.
Compatibility:This pragma is compatible with the following platform targets:
|
68K
|
NEC V800
|
Intel x86
|
MIPS
|
Embedded 68K
|
#pragma fp_contract on | off | reset
Remarks:This pragma applies to PowerPC programming only.
register double A, B, C, D, Y, Z;
register double T1, T2;
A = C = 2.0e23;
B = D = 3.0e23;
Y = (A * B) - (C * D);
printf("Y = %f\n", Y);
/* prints 2126770058756096187563369299968.000000 */
T1 = (A * B);
T2 = (C * D);
Z = T1 - T2;
printf("Z = %f\n", Z); /* prints 0.000000 */
When this option is off, Y and Z have the same value.
This pragma corresponds to the Use FMADD & FMSUB option in the PowerPC Processor settings panel. To check whether this option is on, use __option (fp_contract), described in "Checking Options."