SPL to HP C/XL Migration Guide (30231-90001)

3- 6
Double Integer Constants
Table 3-10. Double Integer Constants
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| Type: DOUBLE | Type: long int or int |
| | |
---------------------------------------------------------------------------------------------
| | |
|
double-integer-constant
: |
long-integer-constant
: |
| | |
| [
sign
]
integer
D | [-]
integer
[L] |
| | |
---------------------------------------------------------------------------------------------
In HP C/XL, the L (specifying long int) is optional, since int and long
int are equivalent and occupy 32 bits. The L may be lowercase.
Based Constants
Table 3-11. Based Constants
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| Type: INTEGER | Type: short int |
| DOUBLE | long int or int |
| LOGICAL | unsigned short int |
| BYTE | unsigned char OR unsigned short |
| | int |
| REAL | float |
| LONG | double |
| | |
---------------------------------------------------------------------------------------------
| | |
|
based-constant
: |
integer-constant
: |
| | |
| [
sign
] % [(
base
)]
value
[
type
] | [-] 0
octal-digits
[L] |
| | |
| | [-] 0X
hex-digits
[L] |
|
type
: | |
| is D, E, or L (for DOUBLE, REAL, or | Only octal and hexadecimal bases may be |
| LONG); default is single word, usable as | specified. Numbers are signed decimal by |
| INTEGER, LOGICAL, or BYTE. | default. The leading character is a zero. |
| | A trailing L forces a long int constant. |
| | The L and X may be lowercase. |
| | |
| | Floating point cannot be specified |
| | directly. |
| | |
---------------------------------------------------------------------------------------------
| | |
| Example: | Example: |
| | |
| %170033
octal
| 0170033
octal
|
| %(16)F01B D
hexadecimal
| 0xF01B L
hexadecimal
|
| %(2)11011011
binary
|
(No equivalent))
|
| | |
---------------------------------------------------------------------------------------------
Since HP C/XL can represent only octal, decimal, and hexadecimal values,
based constants must be converted into one of those forms.