C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Improve Float Consistency: Details
                                             Up Contents Index Back
─────C/C++ Compiler─────────────────────────────────────────────────────────
 
     Syntax:  /Op
              /Op-
 
     The primary use of the /Op option is to improve the consistency of
     tests for equality and inequality. Without the /Op option, the
     compiler usually uses coprocessor registers to hold the
     intermediate results of floating-point calculations. Such
     optimization increases program speed and decreases program size.
 
     The coprocessor has 80-bit registers; the memory representation
     can be 32, 64, or 80 bits. Therefore, storing intermediate results
     in registers can provide a greater degree of precision than
     storing them in memory.
 
     When you use the /Op option, the compiler loads data from memory
     prior to each floating-point operation and, if assignment occurs,
     writes the results back to memory upon completion. Loading the
     data prior to 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.
 
     If you use the /Za (compile for ANSI compatibility) option, CL
     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 with the /Za option will disable /Op.
     See: Enabling and Disabling Language Extensions (/Za, /Ze)
                                    -♦-