User manual
mikroC PRO for dsPIC
MikroElektronika
201
Floating-point Types
The types oat and double, together with the long double variant, are considered to be oating-point types. The
mikroC PRO for dsPIC30/33 and PIC24’s implementation of an ANSI Standard considers all three to be the same
type.
Floating point in the mikroC PRO for dsPIC30/33 and PIC24 is implemented using the Microchip AN575 32-bit format
(IEEE 754 compliant).
An overview of the oating-point types is shown in the table below:
Type Size in bytes Range
oat
4 -1.5 * 10
45
.. +3.4 * 10
38
double
4 -1.5 * 10
45
.. +3.4 * 10
38
long double
4 -1.5 * 10
45
.. +3.4 * 10
38
Enumerations
An enumeration data type is used for representing an abstract, discreet set of values with appropriate symbolic
names.
Enumeration Declaration
Enumeration is declared like this:
enum tag {enumeration-list};
Here, tag is an optional name of the enumeration; enumeration-list is a comma-delimited list of discreet values,
enumerators (or enumeration constants). Each enumerator is assigned a xed integral value. In the absence of
explicit initializers, the rst enumerator is set to zero, and the value of each succeeding enumerator is set to a value of
its predecessor increased by one.
Variables of the enum type are declared the same as variables of any other type. For example, the following
declaration:
enum colors { black, red, green, blue, violet, white } c;
establishes a unique integral type, enum colors, variable c of this type, and set of enumerators with constant integer
values (black = 0, red = 1, ...). In the mikroC PRO for dsPIC30/33 and PIC24, a variable of an enumerated type can be
assigned any value of the type int – no type checking beyond that is enforced. That is:
c = red; // OK
c = 1; // Also OK, means the same