Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Pascal/HP-UX Programmer's Guide > Chapter 4 Predefined Pascal Constants, Data Types, and Modules

Longint

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The predefined data type longint is an integer in the range -263..263-1 that is stored in 64 bits. The compiler option OVFLCHECK has no effect on 64 bit multiply.

Note that there are no longint constants in the compiler. Therefore, numbers outside of the range minint .. maxint can not be expressed directly. The compiler option TYPE_COERCION must be used with a run-time computation. If the numbers are constants, they must be typed coerced to longint so they do not integer overflow.

Example

$standard_level 'hp_modcal'$
program prog_longint(output);

var i : integer;
b : longint;

type rec = record
case integer of
0:(l : longint);
1:(f1,f2: integer);
end;
const v_rec = rec[f1: hex('1'),
f2: hex('ffffffff')]; { longint constant field }
begin
b := v_rec.l;
writeln(b);

try
i := b; { run-time error }
recover ;

$push; type_coercion 'conversion'$
b := longint(1000000) * 1000000;
$pop$

writeln(b);
end.

Output:

  8589934591
1000000000000
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.