Rounding Parameters

On ia32 systems, the rounding flags control the method of rounding that the FPU uses. For example:

 USE DFLIB
 INTEGER(2) control, clearcontrol, newcontrol
 CALL GETCONTROLFPQQ(control)
 ! Clear any existing rounding flags.
 clearcontrol = (control .AND. (.NOT. FPCW$MCW_RC))
 newcontrol = clearcontrol .OR. FPCW$UP
 ! Set rounding mode to round up.
 CALL SETCONTROLFPQQ(newcontrol)

The rounding options are mutually exclusive. If you set more than one, you may get an invalid mode or a mode other than the one you want. Therefore, you should clear the rounding bits before setting a new rounding mode.