pTAL Reference Manual (H06.08+)
Expressions
HP pTAL Reference Manual—523746-006
5-8
Using FIXED(*) Variables
Using FIXED(*) Variables
pTAL does not scale data items that it stores into FIXED(*) items.
The following procedure has one local variable whose data type is FIXED(*):
PROC p;
BEGIN
FIXED(*) f;
f := 1234F;
END;
The data type of a FIXED(*) variable is the same as a FIXED variable when it is used
in an expression:
FIXED(*) f1 := 123F;
FIXED(2) f2;
f2 := f1; ! f2 is assigned 123.00
pTAL does not scale data when it is stored into a FIXED(*) variable:
FIXED(2) f1 := 1.23F;
FIXED(*) f2;
FIXED f3;
f2 := f1; ! f2 is assigned 123
f3 := f1; ! f3 is assigned 1
The following example further illustrates this:
FIXED(*) f1;
FIXED(3) f2 := 1.234F;
f1 := f2; ! f1 = 1234
f2 := f1; ! f2 = 1234.000
f1 := f2; ! f1 = 1234000
f2 := f1; ! f2 = 1234000.000
f1 := f2; ! f1 = 1234000000
f2 := f1; ! f2 = 1234000000.000
Unsigned Arithmetic Operators
Typically, you use binary unsigned arithmetic on operands with values in the range 0
through 65,535. For example, you can use unsigned arithmetic with pointers that
contain standard addresses.
Table 5-6. Unsigned Arithmetic Operators (page1of2)
Operator Operation Operand Type Example
'+' Unsigned addition STRING, INT, or
UNSIGNED(1-16)
alpha '+' beta
'-' Unsigned subtraction STRING, INT, or
UNSIGNED(1-16)
alpha '-' beta
'*' Unsigned multiplication STRING, INT, or
UNSIGNED(1-16)
alpha '
*
' beta










