10.4 Fixed-Point Data Types

The following table shows fixed-point data types that are supported by the compiler when the -menable-fixed command line option is specified. See Fixed-Point Arithmetic Support for more details on the compiler's support for the fixed-point C language dialect. If the signed or unsigned type specifier is not present, the type is assumed to be signed.

Table 10-3. Fixed Point Integer Data Types
TypeBitsMinMax
_Fract16-1.01.0 - 2^-15
short _Fract16-1.01.0 - 2^-15
signed _Fract16-1.01.0 - 2^-15
signed short _Fract16-1.01.0 - 2^-15
unsigned _Fract160.01.0 - 2^-15
unsigned short _Fract160.01.0 - 2^-15
long _Fract32-1.01.0 - 2^-31
signed long _Fract32-1.01.0 - 2^-31
unsigned long _Fract320.01.0 - 2^-31
_Accum40-256.0256.0 - 2^-31
short _Accum40-256.0256.0 - 2^-31
long _Accum40-256.0256.0 - 2^-31
signed _Accum40-256.0256.0 - 2^-31
signed short _Accum40-256.0256.0 - 2^-31
signed long _Accum40-256.0256.0 - 2^-31
unsigned _Accum400.0256.0 - 2^-31
unsigned short _Accum400.0256.0 - 2^-31
unsigned long _Accum400.0256.0 - 2^-31

As with integer and floating point data types, all fixed-point values are represented in a little endian format, which means:

  • The Least Significant Byte (LSB) is stored at the lowest address
  • The Least Significant bit (LSb) is stored at the lowest-numbered bit position