SPL to HP C/XL Migration Guide (30231-90001)
5- 2
Table 5-2. Automatic Unary Type Conversions
---------------------------------------------------------------------------------------------
| | |
| Original Type | Converted to |
| | |
---------------------------------------------------------------------------------------------
| | |
| char | int |
| | |
---------------------------------------------------------------------------------------------
| | |
| short int | int |
| | |
---------------------------------------------------------------------------------------------
| | |
| unsigned char | unsigned int |
| | |
---------------------------------------------------------------------------------------------
| | |
| unsigned short int | unsigned int |
| | |
---------------------------------------------------------------------------------------------
| | |
| float | double 1 |
| | |
---------------------------------------------------------------------------------------------
| | |
| int | int 2 |
| | |
---------------------------------------------------------------------------------------------
| | |
| long int | long int 2 |
| | |
---------------------------------------------------------------------------------------------
| | |
| unsigned int | unsigned int 2 |
| | |
---------------------------------------------------------------------------------------------
| | |
| unsigned long int | unsigned long int 2 |
| | |
---------------------------------------------------------------------------------------------
| |
| 1 This conversion from float to double may be prevented with the HP C/XL compiler |
| option "-Wc,-r". See the
HP C/XL Reference Manual Supplement
for details. |
| |
| 2 These types are not converted. They are included here for completeness. |
| |
---------------------------------------------------------------------------------------------
Second, arithmetic operands in binary operations are converted. If the
two operands are the same type, the conversion is complete. Otherwise,
the process continues row-by-row through Table 5-3 until a conversion
makes the operand types equal.
Table 5-3. Automatic Binary Type Conversions
---------------------------------------------------------------------------------------------
||| |
| One Operand | Other Operand | Conversion |
||| |
---------------------------------------------------------------------------------------------
||| |
| double | any type | Other becomes double |
||| |
---------------------------------------------------------------------------------------------
||| |
| float | any type | Other becomes float |
||| |
---------------------------------------------------------------------------------------------
||| |