HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
3- 16
Numeric Literals
Numeric literals are real numbers or integers.
Syntax
For literal integers (
lit_integer
):
digit
[
digit
]
For literal real numbers:
lit_integer
[.[
lit_integer
]][E[+,-]
lit_integer
] .
lit_integer
[E[+,-]
lit_integer
]
Parameters
digit
A single digit 0..9.
lit_integer
A number consisting of any combination of the digits 0..9.
Examples
Table 3-16. Examples of Numeric Literals
-----------------------------------------------------------------------------------------
| |
| Literal Integers Literal Real Numbers |
| |
-----------------------------------------------------------------------------------------
| |
| 8 9.00 |
| |
| 123 35.9E+6 |
| |
| 406903 .74E-3 |
| |
-----------------------------------------------------------------------------------------
A literal integer is stored as an integer or a short integer, depending
on the range required.
Context determines the data type used to store a literal fixed-point or
floating-point number. A literal floating-point number is stored as a
real or decimal, depending on the precision required.
A literal that is beyond the range of the data type that it is to be
stored in is rounded. If it is beyond the range of the largest data
type, an error occurs.
String Literals
String literals are quoted string literals or special character string
literals.
Syntax
Quoted string literal: