用于开发税务票据管理的软件

源代码在线查看: d2r2.txt

软件大小: 36519 K
上传用户: jill
关键词: 软件
下载地址: 免注册下载 普通下载 VIP

相关代码

				implementation
				//PROGRAM D2R2
				//Driver for routine RATINT
				uses
				  unit2;
				  {$R *.DFM}
				Function FUNC(x:real):real;
				begin
				    FUNC:= X * Exp(-X)/(Sqr(X - 1)+1);
				end;
				
				procedure TForm1.Button1Click(Sender: TObject);
				var
				  X,Y:array[0..6] of real;
				  XX,YY,DYY,YEXP:real;
				  F:TextFile;  I:Integer;
				const
				  NPT=6; s1='%12.6f'; s2='0.0000E+00'; s3='%6.2f';
				begin
				  For I:=1 to NPT do
				  begin
				      X[I]:= I * 2 / NPT;
				      Y[I]:= FUNC(X[I]);
				  end;
				  //输出计算结果到文件
				  AssignFile(F, 'd:\delphi_shu\p2\d2r2.dat');
				  Rewrite(F);
				  Writeln(F, 'Diagonal rationnal function interpolation');
				  Writeln(F,'    X      interap.    accuracy     actual');
				  For I:=1 To 10 do
				  begin
				      XX:= 0.2 * I;
				      RATINT(X, Y, NPT, XX, YY, DYY);
				      YEXP:= FUNC(XX);
				      Writeln(F,Format(s3,[XX]),Format(s1,[YY]),'    ',
				          FormatFloat(s2,DYY),Format(s1,[YEXP]));
				  end;
				  CloseFile(F);
				  //屏幕显示计算结果
				  memo1.ScrollBars:=ssVertical;
				  memo1.Lines.LoadFromFile('d:\delphi_shu\p2\d2r2.dat');
				end;			

相关资源