[fpc-pascal]bug?

Jan Feitsma jan.feitsma at wxs.nl
Thu Oct 11 20:52:48 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!

Greetings Jan Feitsma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20011011/f818ed52/attachment.html>


More information about the fpc-pascal mailing list