[fpc-pascal]bug?
Peter Vreman
peter at freepascal.org
Fri Oct 12 09:59:01 CEST 2001
> Hello
>
> I think i've found a problem with respect to big integers (int64,qword
> types).
> Please look at the following testprogram and tell me if there's a patch.
> I'm using fpc version 1.0.4 on Win32.
>
>
> program Bugtest(input,output);
> var
> big : int64;
>
> function intpower(b,p : longint) : int64;
> var i : longint;
> begin
> intpower:=1;
> for i:=1 to p do intpower:=b*intpower;
> end;
>
> begin { main }
> big := 4294967296; { =2^32 }
> writeln(' 2^32=',big);
> writeln(' 2^32=',intpower(2,32));
> end.
>
> This program gives the following output:
>
> 2^32=0
> 2^32=4294967296
>
> Apparently something has gone wrong putting
> the value 2^32 into 'big'
>
> Please help me!
Try a 1.1 development snapshot. The 1.1 development series supports constant values larger
than maxlongint better
More information about the fpc-pascal
mailing list