11.3 Rounding

Three rounding modes are supported, corresponding to the three rounding modes supported by the 16-bit device fixed-point multiplication facilities.

Table 11-3. Rounding Modes
ModeDescription
TruncationTruncate signed result - round toward -saturation
ConventionalRound signed result to nearest, ties toward +saturation
ConvergentRound signed result to nearest, ties to even

All operations on fixed point variables, whether intrinsically supported by the hardware or not, are performed according to the prevailing rounding mode chosen. The rounding mode may be specified globally via the -menable-fixed compiler switch, as described in the Driver Option Descriptions section or on a function-by-function basis, via the -round attribute, as described in Function Attributes.

These modes are described in more detail in the “16-bit MCU and DSC Programmer’s Reference Manual” (DS70157).