HP C A.06.05 Reference Manual
Program Organization
Constants
Chapter 2 25
Integer constants may not contain any punctuation such as commas or periods.
Examples of Integer Constants
The following examples show some legal constants in decimal, octal, and hexadecimal form:
Floating-Point Constants
A floating-point constant is any number that contains a decimal point and/or exponent sign
for scientific notation.
The number may be followed by an f or F, to signify that it is of type float,orbyanl or L,to
signify that it is of type long double. If the number does not have a suffix, it is of type double
even if it can be accurately represented in four bytes.
If the magnitude of a floating-point constant is too great or too small to be represented in a
double, the C compiler will substitute a value that can be represented. This substitute value is
not always predictable.
both letters u or U and ll or LL
suffix:
unsigned long long
Table 2-4 Convention Summary
Decimal Octal Hexadecimal
3 003 0x3
8 010 0x8
15 017 0xF
16 020 0x10
21 025 0x15
-87 -0127 -0x57
187 0273 0xBB
255 0377 0xff
Table 2-3 Convention Summary (Continued)
Constant Assigned Data Type