相关代码 |
|
Sub MIDPNT(A, B, S, N) If N = 1 Then S = (B - A) * FUNC(0.5 * (A + B)) IT = 1 Else IT = 3 ^ (N - 2) TNM = IT DEL = (B - A) / (3# * TNM) DDEL = DEL + DEL X = A + 0.5 * DEL Sum = 0# For J = 1 To IT Sum = Sum + FUNC(X) X = X + DDEL Sum = Sum + FUNC(X) X = X + DEL Next J S = (S + (B - A) * Sum / TNM) / 3# End If End Sub
相关资源 |
|