2.3.5. - Numeric Constants
Numeric constants
can be integers
or floating
point numbers.
Integer constants are considered
octal if the first digit is
0. Valid digits in the rest of the constant are
0 through
7. A hexadecimal
constant begins with
0x or
0X and is followed by
digits or the letters
a or
A through
f or
F, which have values 10 through 15.
Otherwise, a sequence of digits is a decimal
constant.
Floating-point constants have an integer part, a decimal point,
a fraction part,
an
e or
E and an optionally signed exponent.
The integer part or the fraction part,
but not both, may be missing.
The decimal point or the
e and exponent, but not both, may be missing.
Octal and hexadecimal constants can have values from
±231.
As spec stores number values internally in double-precision format,
the range of
other integer and floating constants
is determined by the range of double-precision
numbers allowed by the host computer's compiler and architecture.
To conserve resources, spec by default stores the numbers used in
the data group facility
in single-precision format.
Double-precision can be selected at the spec administrator's option,
though, when spec is installed.
The following are valid numeric constants.
65535 0177777 0xFFFF
+1066 1.066e3 1.066e+3
|