9.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 10 Fixed-Point Arithmetic Support - dsPIC33C/E/F and dsPIC30 Only 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 9-4. Fixed Point Integer Data Types
Type Bits Min Max
_Fract 16 -1.0 1.0 - 2-15
short _Fract 16 -1.0 1.0 - 2-15
signed _Fract 16 -1.0 1.0 - 2-15
signed short _Fract 16 -1.0 1.0 - 2-15
unsigned _Fract 16 0.0 1.0 - 2-15
unsigned short _Fract 16 0.0 1.0 - 2-15
long _Fract 32 -1.0 1.0 - 2-31
signed long _Fract 32 -1.0 1.0 - 2-31
unsigned long _Fract 32 0.0 1.0 - 2-31
_Accum 40 -256.0 256.0 - 2-31
short _Accum 40 -256.0 256.0 - 2-31
long _Accum 40 -256.0 256.0 - 2-31
signed _Accum 40 -256.0 256.0 - 2-31
signed short _Accum 40 -256.0 256.0 - 2-31
signed long _Accum 40 -256.0 256.0 - 2-31
unsigned _Accum 40 0.0 256.0 - 2-31
unsigned short _Accum 40 0.0 256.0 - 2-31
unsigned long _Accum 40 0.0 256.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