RC, RD, RN, RP, RU, and RZ (Round) Editing (Fortran 2003)

Purpose

Round edit descriptors are used in a Format statement and are one of RC, RD, RN, RP, RU, and RZ, which correspond to the COMPATIBLE, DOWN, NEAREST, PROCESSOR_DEFINED, UP, and ZERO rounding modes respectively. The round edit descriptors temporarily change the connections rounding mode in formatted I/O. The round edit descriptors only affect D, E, ES, EN, F and G editing.

Syntax

Rules

The round edit descriptors help specify how decimal numbers are converted to an internal representation (i.e. in binary) from a character representation and vice versa during formatted input and output.

Examples

	program main
   	real :: i
	   100 format (f10.7, ru )
	   open(UNIT=2,file ='temp.txt', form='formatted', round='compatible' )
	   read(UNIT=2, 100) i
	   print '(f10.7	, ru)' i
	end program
	
	Input - temp.txt
	3.1415926
	Output - temp.txt
	3.1415928