pTAL Reference Manual (H06.08+)
Data Representation
HP pTAL Reference Manual—523746-006
3-20
REAL and REAL(64) Numeric
Examples of REAL and REAL(64) numeric constants, showing the integer part, the
fractional part, the E or L suffix, and the exponent part:
The system stores the number in binary scientific notation in the form:
x * 2
y
x is a value of at least 1 but less than 2. Because the integer part of x is always 1, only
the fractional part of x is stored.
The exponent can be in the range -256 through 255 (%377). The system adds 256
(%400) to the exponent before storing it as y. Thus, the value stored as y is in the
range 0 through 511 (%777), and the exponent is y minus 256.
If the value of the number to be represented is zero, the sign is 0, the fraction is 0, and
the exponent is 0.
The system stores the parts of a floating-point constant as follows:
Examples of storage formats:
1. For the following REAL constant, the sign bit is 0, the fraction bits are 0, and the
exponent bits contain %400 + 2, or %402:
4 = 1.0 * 2
2
stored as %000000 %000402
2. For the following REAL constant, the sign bit is 1, the fraction bits contain %.2
(decimal .25 is 2/8), and the exponent bits contain %400 + 3, or %403:
-10 = -(1.25 * 2
3
) stored as %120000 %000403
3. For the following REAL(64) constant, the sign bit is 0, the fraction bits contain the
octal representation of .33333..., and the exponent bits contain %400 - 2, or %376:
1/3 = .33333…* 2
-2
stored as %025252 %125252 %125252 %125376
Decimal Value REAL REAL(64)
0 0.0E0 0.0L0
22.0e0
0.2E1
20.0E-1
2.0L0
0.2L1
20.0L-1
-17.2 -17.2E0
-1720.0E-2
-17.2L0
-1720.0L-2
Data Type Sign Bit Fraction Exponent
REAL <0> <1:22> <23:31>
REAL(64) <0> <1:54> <55:63>










