[fpc-pascal]Longer than longint?
bronco at olagrande.net
Sat Mar 2 21:55:38 CET 2002
On Sat, 2 Mar 2002, Tom Verhoeff wrote:
> >>Is there a formal integer data type larger than longint?
> >You can use int64 which is a signed 64 Bit type or if you don't need
> >bit operations, use the comp type.
> >>Also, are there
> >>any potential problems involving representing large integers in the
> >>"extended" real format (like hidden processor rounding or whatever)?
> >The extended type leads to no rounding errors if the numbers
> >stay in the range of signed 64 bit mantissa.
> However, both Int64 and Comp will NOT allow iteration with a for loop:
> const c10e9 = 1000000000;
> var i: Int64;
> for i := c10e9 to c10e9 + 9 do
> writeln ( 'i = ', i )
> You get
> Error: Ordinal expression expected (at the i in "for i := ...")
> This copies the behavior of Delphi. Nevertheless, I consider it a
> bug in Delphi and FPC that for loops over Int64 are rejected. The
> documentation states that Int64 is an ordinal (integer) type. It
> is quite natural to have for loops over this type.
Yes, I'm getting an "ordinal expression expected" error (using
freepascal under dev-pas, I'm told) for an inc(variable) expression using
the comp type. so it looks as if the compiler actually regards these as
More information about the fpc-pascal