HP Pascal/iX Reference Manual (31502-90022)

3- 4
NOTE For relational tests, the two operands must be compatible types.
When membership tests are performed, the left-operand type must be
a single ordinal value, while the right-operand is of a SET type.
Bit16.
The predefined data type
bit16
is a subrange, 0..65535, that is stored in
16 bits.
bit16
is a unique HP Pascal type because arithmetic operations
on
bit16
data are truncated to modulo 65536 when stored.
Permissible Operators
assignment :=
relational <, <=, =, <>, >=, >, IN
arithmetic +, -, *, /, DIV, MOD
Standard Functions
bit16 argument - abs ln sin
arctan odd sqr
chr ord sqrt
cos pred succ
exp
bit16 return - pred
succ
Standard Procedures
prompt strread
read strwrite
readdir writedir
readln writeln
Example
program bits1 (output);
var q:bit16;
begin
q:=hex('ffff');
q:=q + 1; { q is now 0 }
writeln('wrapped around value = ',q:1);
end.
Output:
wrapped around value = 0
Bit32.
The predefined data type
bit32
is a subrange, 0..232-1, that is stored in
32 bits.
bit32
is a unique HP Pascal type because arithmetic operations
on
bit32
data are performed with unsigned 32 bit integers.
Permissible Operators
assignment :=