INTERFACEBy default, the procedures in the
FmtBufinterface for formatting real numbers use the current rounding mode to round the result when fewer digits of precision are requested than are provided automatically by
Float.ToDecimal. In order to test the implementation of the
FmtBufinterface, we would like to be able to exercise it under each rounding mode. Unfortunately, not all rounding modes are necessarily supported by each architecture. In particular, the
FloatMode.SetRoundingprocedure may raise the exception
FloatMode.Failureif the requested rounding mode is not supported by the underlying architecture.
This interface provides a mechanism for test programs to override this default behavior and fix the current rounding mode, even if it is not supported by the underlying architecture.
IMPORT FloatMode; VAR useCurrentRounding := TRUE; testRoundingMode: FloatMode.RoundingMode;If
TRUE, then the procedures in
FmtBuffor formatting real numbers use the current rounding mode. In this case, the value of the global variable
FALSE, then these procedures use
testRoundingMode as the rounding mode, even if it is not a rounding
mode supported by the underlying architecture.