Hexadecimal floating-point literals
Real hexadecimal floating-point constants, which are a C99 feature,
consist of the following:
- a hexadecimal prefix
- a significant part
- a binary exponent part
- an optional suffix
The significant part represents a rational number and is composed
of the following:
- a sequence of hexadecimal digits (whole-number part)
- an optional fraction part
The exponent part indicates the power of 2 to which the significant
part is raised, and is an optionally signed decimal integer. The type
suffix is optional. The full syntax is as follows:
The suffix
f
or F
indicates
a type of float
, and the suffix l
or L
indicates
a type of long double
. If a suffix is not specified,
the floating-point constant has a type double
. You
can omit either the whole-number part or the fraction part, but not
both. The binary exponent part is required to avoid the ambiguity
of the type suffix F
being mistaken for a hexadecimal
digit.