nlaitkenmainmodule.bas
来自「工程数值分析中的一些常用工具,相信对大家很有用的」· BAS 代码 · 共 24 行
BAS
24 行
Attribute VB_Name = "MainModule"
Sub Main()
Dim n As Integer
Dim x As Double
' 迭代初值
x = 0
'求解
n = NLAitkenRoot(x, 60, 0.000001)
If n > 0 Then
MsgBox "x = " & x
Else
MsgBox "求解失败"
End If
End Sub
' 待求解的方程的函数
Function Func(x As Double) As Double
Func = 6 - x * x
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?