Dealing with long integers in pascal

Is there a way in pascal to have a variable that is  atleast 13 digits long? I have a code but can't not get the right results because of the length. I manage to get the right answer in python though. My code is listed below
program factorial;
 
uses sysutils;
 
function factorial(num : Integer) : Cardinal;
begin
	if num <= 1 then
		factorial := 1
	else
		factorial := num * factorial(num - 1);
end;
var
	total : Cardinal;
	index : Integer;
begin
	total := 0;
	index := 0;
		for index := 1 to 15 do
		begin
			writeln(index);
			total := total + factorial(index);
		end;
	Writeln(total);
end.

Open in new window

LVL 1
codecaineAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
codecaineConnect With a Mentor Author Commented:
Never mind I figured out the solution. I could use int64 :)
0
All Courses

From novice to tech pro — start learning today.