English
Language : 

CC78K0S Datasheet, PDF (49/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 2 CONSTRUCTS OF C LANGUAGE
2.4 Constants
A constant is a variable that does not change in value during the execution of the program, and its value must be
set beforehand. A type for each constant is determined according to the format and value specified for the constant.
The following four constant types are available.
• Floating-point constants
• Integer constants
• Enumeration constants
• Character constants
2.4.1 Floating-point constant
A floating-point constant consists of a valid digit part, exponent part, and floating-point suffix.
Valid digit part:
Integer part, decimal point, and fraction part
Exponent part:
e or E, signed exponent
Floating point suffix: f/F (float)
I/L (long double)
If omitted (double)
The signed exponent of the exponent part and the floating-point suffix can be omitted.
Either the integer part or fraction part must be included in the valid digits. Also, either the decimal point or
exponent part must be included (example: 1.23F, 2e3).
2.4.2 Integer constant
An integer constant starts with a number and does not have the decimal point or the exponent part. An unsigned
suffix can be added after the integer constant to indicate that the integer constant is unsigned. A long suffix can be
added after the integer constant to indicate that the integer constant is long.
There are the following three types of integer constant.
• Decimal constant:
Decimal number that starts with a number other than 0
Decimal number = 123456789
• Octal constant:
Integer suffix 0 + octal number
Octal number = 01234567
• Hexadecimal constant: Integer suffix 0x or 0X + hexadecimal number
Hexadecimal number = 0123456789
abcdef ABCDEF
Unsigned suffix
uU
Long suffix
lL
(1) Decimal constant
A decimal constant is an integer value with a base (radix) of 10 and must begin with a number other than 0
followed by any numbers 0 through 9 (example: 56U).
User’s Manual U14872EJ1V0UM
49