Constants in expressions¶
Numeric, alphanumeric and character constants may be freely used in expressions.
An alphanumeric constant, or text string, is any item which appears in double quotes.
A character constant is a single character in single quotes. This generates an integer constant whose value is the ASCII code of the character specified. For example: ‘a’ generates the ASCII code of the letter a: 97.
A numeric constant may be any of three types.
Integer |
A sequence of digits, optionally
preceded by a unary + or -.
Examples: -435, 7364
|
Fixed point |
A sequence of digits, optionally
preceded by a unary + or -. It may
contain a decimal point, the
entire construction introduced by
the # character. The maximum
number of decimal places is 4. The
value is stored internally as an
integer with implied decimal
places.
Examples: #1.15, #-0.1234
|
Floating point |
A sequence of digits which
contains a decimal point,
optionally preceded by a unary +
or -, or a constant expressed in
exponential format.
Examples: 178.625, 123.4e7,
78.9E-3
|