HP C A.06.05 Reference Manual

Program Organization
Constants
Chapter 226
You may precede a floating-point constant with the unary plus or minus operator to make its
value positive or negative.
Scientific Notation
Scientific notation is a useful shorthand for writing lengthy floating-point values. In scientific
notation, a value consists of two parts: a number called the mantissa followed by a power of
10 called the characteristic (or exponent).
The letter e or E, standing for exponent, is used to separate the two parts.
The floating-point constant 3e2, for instance, is interpreted as 3*(10
2
), or 300. Likewise, the
value -2.5e-4 is interpreted as -2.5/(10
4
), or -0.00025.
Examples of Floating-Point Constants
Here are some examples of legal and illegal floating-point constants.
Table 2-5 Floating-Point Constants
Constant Legal or Illegal
3. legal
35 legal — interpreted as an integer.
3.141 legal
3,500.45 illegal — commas are illegal.
.3333333333 legal
4E illegal — the exponent must be followed by a number
0.3 legal
-3e2 legal
4e3.6 illegal — the exponent must be an integer
3.0E5 legal
+3.6 legal
0.4E-5 legal