Compartilhar via


/Op, /OP - Improve Floating-Point Consistency (Windows CE 5.0)

Send Feedback

This option improves the consistency of floating-point tests for equality and inequality by disabling optimizations that could change the precision of floating-point calculations.

By default, the compiler uses the coprocessor's 80-bit registers to hold the intermediate results of floating-point calculations. This increases program speed and decreases program size.

However, because the calculation involves floating-point data types represented in memory by less than 80 bits, carrying the extra bits of precision (80 bits minus the number of bits in a smaller floating-point type) through a lengthy calculation can produce inconsistent results.

With /Op, the compiler loads data from memory before each floating-point operation and, if assignment occurs, writes the results back to memory upon completion. Loading the data before each operation guarantees that the data does not retain any significance greater than the capacity of its type.

A program compiled with /Op may be slower and larger than one compiled without /Op.

Note   The /Op option disables inline generation of floating-point functions. It uses the standard run-time library routines instead. For more information, see the /Oi - Generate Intrinsic Functions option.

If you use the /Za - Disable Language Extensions option to compile for ANSI compatibility, the compiler uses the /Op option to improve the consistency of floating-point tests for equality and inequality.

This use of /Op with /Za is for strict ANSI conformance and is the only situation under which /Op is selected by default. The /Op- option is provided to override the default selection of /Op with /Za. Placing the /Op- option on the command line after the /Za option disables /Op.

See Also

Compiler Options | /Za - Disable Language Extensions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.