10.3 Rounding

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

Table 10-3. Rounding Modes
Mode Description
Truncation Truncate signed result - round toward -saturation
Conventional Round signed result to nearest, ties toward +saturation
Convergent Round 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 6.6 Driver Option Descriptions section or on a function-by-function basis, via the round attribute, as described in 14.1.2 Function Attributes.

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