HP Pascal/iX Reference Manual (31502-90022)
Table Of Contents
- Top of Document
- Preface
- Chapter 1 Introduction
- Chapter 2 Language Elements
- Chapter 3 Data Types
- Chapter 4 Expressions
- Chapter 5 The Declaration Section
- Chapter 6 Statements
- Chapter 7 Program Structure
- Chapter 8 Procedures and Functions
- Chapter 9 Standard Routines
- Chapter 10 Input and Output
- Chapter 11 System Programming Extensions
- Chapter 12 Compiler Options
3- 5
relational <, <=, =, <>, >=, >, IN
arithmetic +, -, *, /, DIV, MOD
Standard Functions
bit32 argument - abs ln sin
arctan odd sqr
chr ord sqrt
cos pred succ
exp
bit32 return - pred
sqr
succ
Standard Procedures
prompt strread
read strwrite
readdir writedir
readln writeln
NOTE The multiply operator (*) may cause overflow traps. See
"OVFLCHECK" .
Example
$standard_level 'hp_modcal'$
program bits2(output);
var q,r:bit32;
begin
{ one way to get bit32 constants >= 2 ** 31 }
$push; type_coercion 'conversion'; range off$
q:=bit32(hex('ffffffff')) + 1; { q is now 0 }
r:=bit32(hex('7fffffff')) + 1; { r is now > maxint }
$pop$
writeln('wrapped around value = ',q:1);
writeln('past maxint value = ',r:1);
end.
Output:
wrapped around value = 0
past maxint value = 2147483648
Bit52.
The predefined data type
bit52
is a subrange, 0..252-1, that is stored in
64 bits.
bit52
is a unique HP Pascal type because arithmetic operations
on
bit52
data are performed with unsigned 64 bit integers.
Permissible Operators
assignment :=
relational <, <=, =, <>, >=, >, IN
arithmetic +, -, *, /, DIV, MOD