English
Language : 

CC78K4 Datasheet, PDF (68/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 4 TYPE CONVERSIONS
(3) Usual arithmetic type conversions
Types obtained as a result of operations on arithmetic type data have a wide range of values.
The type conversion of the operation result is performed as follows.
• If either one of the operands has long double type, the other operand is converted to long double type.
• If either one of the operands has double type, the other operand is converted to double type.
• If either one of the operands has float type, the other operand is converted to float type.
In cases other than above, general integer expansion is performed for both operands according to the following
rules. Figure 4-1 shows the rules.
Figure 4-1. Usual Arithmetic Type Conversions
unsigned long int
long int
unsigned int
int
If either of the two operands is unsigned long int type, or if one
operand is long int type and the other is unsigned int type
and the value of unsigned int type cannot be represented by long int type.
both operands will be converted to unsigned long int type.
In cases other than above, if one operand is long int type and if the value of
the other operand can be represented by long int type, the other operand will be
converted to long int type.
In cases other than above, if one operand is unsigned int type, the other operand
will be converted to unsigned int type.
In cases other than above, both operands will have int type.
In this compiler, the conversion to int type can be intentionally disabled by a compile condition (optimizing
option) (For details, refer to CC78K4 C Compiler Operation User’s Manual (U15557E) CHAPTER 5
COMPILER OPTIONS).
68
User’s Manual U15556EJ1V0UM