Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

OPEN: ROUND Specifier

The ROUND specifier indicates the I/O rounding mode for the duration of a connection. It takes the following form:

ROUND = rmode

rmode

Is a scalar default character expression that evaluates to one of the following values:

'UP'

The smallest representable value that is greater than or equal to the original value.

'DOWN'

The largest representable value that is less than or equal to the original value.

'ZERO'

The value closest to the original value, but no greater in magnitude than the original value.

'NEAREST'

Conforms to the ISO/IEC 60559:2020 standard specification for roundTiesToEven.

'COMPATIBLE'

The closer of the two nearest representable values. If the value is halfway between the two values, the one chosen is the one farther from zero.

'PROCESSOR_DEFINED'

The value is determined by the default settings in the processor, which may correspond to one of the other modes.

The default I/O rounding mode is 'PROCESSOR_DEFINED'. This corresponds to 'NEAREST'.

The rounding modes conform to the corresponding rounding modes specified in the ISO/IEC 60559:2020 standard.

You can only use this specifier for a formatted I/O connection.

The rounding mode is an overridable mode. It can be temporarily changed within a READ or WRITE by the ROUND= specifier in the I/O control list or by the corresponding RU, RD, RZ, RN, RC, and RP edit descriptors in the format specified in the I/O control list.

This specifier is not allowed on unformatted input or output.

See Also