fleg.pas

来自「Delphi Pascal 数据挖掘领域算法包 数值算法大全」· PAS 代码 · 共 24 行

PAS
24
字号
PROCEDURE fleg(x: real; VAR pl: glnlarray; nl: integer);
(* Programs using routine FLEG must define the type
TYPE
   glnlarray = ARRAY [1..nl] OF real;
in the main routine. *)
VAR
   j: integer;
   twox,f2,f1,d: real;
BEGIN
   pl[1] := 1.0;
   pl[2] := x;
   IF (nl > 2) THEN BEGIN
      twox := 2.0*x;
      f2 := x;
      d := 1.0;
      FOR j := 3 TO nl DO BEGIN
         f1 := d;
         f2 := f2+twox;
         d := d+1.0;
         pl[j] := (f2*pl[j-1]-f1*pl[j-2])/d
      END
   END
END;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?