unit Unit2;
interface
uses
unit1;
procedure EULSUM(var SUM:real; TERM:real; JTERM:integer);
implementation
procedure EULSUM(var SUM:real;TERM:real;JTERM:integer);
var
J:Integer; TMP,DUM:real;
WKSP:array[0..41] of real;
begin
If JTERM = 1 Then
begin
NTERM^:=1;
WKSP[1]:=TERM;
SUM:=0.5 * TERM;
end
Else
begin
TMP:=WKSP[1];
WKSP[1]:=TERM;
For J:=1 To NTERM^ do
begin
DUM:=WKSP[J + 1];
WKSP[J + 1]:=0.5 * (WKSP[J] + TMP);
TMP:=DUM;
end;
If Abs(WKSP[NTERM^ + 1]) begin
SUM:=SUM + 0.5 * WKSP[NTERM^ + 1];
NTERM^:=NTERM^ + 1;
end
Else
SUM:=SUM + WKSP[NTERM^ + 1];
end;
end;
end.