Floating-point and integer control
None.
Specifies the rounding mode for the compiler to use when evaluating constant floating-point expressions at compile time.
The syntax depends on whether the ROUND option is used with a base 2 IEEE-754 binary format (specified by the FLOAT(IEEE) compiler option), base 16 z/Architecture® hexadecimal format (specified by the FLOAT(HEX) compiler option), or base 10 decimal floating-point format (specified by the DFP compiler option).
When FLOAT(IEEE) is specified:
.-N-. >>-ROUND--(--+-M-+--)------------------------------------------>< +-P-+ '-Z-'
When FLOAT(HEX) is specified:
>>-ROUND--(--Z--)----------------------------------------------><
When DFP is specified:
.-DN--. >>-ROUND--(--+-DI--+--)---------------------------------------->< +-DM--+ +-DNA-+ +-DNZ-+ +-DP--+ '-DZ--'
The rounding mode depends on whether the ROUND option is used with the DFP compiler option.
If FLOAT(IEEE) is in effect but DFP is not in effect, the following modes are valid:
If the DFP compiler option is in effect, the following modes are valid:
You can specify a rounding mode only when you use IEEE floating-point mode. In hexadecimal mode, the rounding is always towards zero.
You must ensure that you are in the same rounding mode at compile time (specified by the ROUND(mode) option), as at run time. Entire compilation units will be compiled with the same rounding mode throughout the compilation. For further information on the DFP header files and functions, see z/OS XL C/C++ Runtime Library Reference. If you switch runtime rounding modes inside a function, your results may vary depending upon the optimization level used and other characteristics of your code; use caution if you switch rounding mode inside functions.
If you specify ROUND(mode) in hexadecimal floating-point mode, where mode is not Z, the compiler ignores ROUND(mode) and issues a warning.
The IPA compile step generates information for the IPA link step. The ROUND option also affects the regular object module if you request one by specifying the IPA(OBJECT) option.
The IPA link step merges and optimizes the application code, and then divides it into sections for code generation. Each of these section is a partition. The IPA link step uses information from the IPA compile step to ensure that an object is included in a compatible partition. Refer to the FLOAT for further information.
None.