5.3.7.2 Floating-point Constants
Floating-point constants have double
type unless suffixed
by f
or F
, in which case it is a float
constant. The suffixes l
or L
specify a long
double
type which is considered an identical type to double
by
MPLAB XC8.
Floating-point constants can be specified as decimal digits with a decimal
point and/or an exponent. They can alternatively be expressed as hexadecimal digits and a
binary exponent initiated with either
p
or P
. For
example:myFloat = -123.98E12; // decimal representation
myFloat = 0xFFEp-22; // hexadecimal representation