相关代码 |
|
unit Unit2; interface procedure POLDIV(U:array of real; N:integer;V:array of real; NV:integer; var Q, R:array of real); implementation procedure POLDIV(U:array of real; N:integer;V:array of real; NV:integer; var Q, R:array of real); var J,K:integer; begin For J:=1 To N do begin R[J]:=U[J]; Q[J]:=0 ; end; For K:=N - NV DownTo 0 do begin Q[K + 1]:=R[NV + K] / V[NV]; For J:=NV + K - 1 DownTo K + 1 do R[J]:=R[J] - Q[K + 1] * V[J - K]; end; R[NV]:=0 ; end; end.