nlqrrootmainmodule.bas

来自「科学与工程数值计算算法(Visual Basic版)一书的源代码。对科学研究者自」· BAS 代码 · 共 21 行

BAS
21
字号
Attribute VB_Name = "MainModule"
Sub Main()
    Dim x As Double
    
    ' 迭代初值
    x = 1
    
    '求解
    If NLPqRoot(x, 0.000001) Then
        MsgBox "x = " & x
    Else
        MsgBox "求解失败"
    End If
    
End Sub

' 待求解的方程的函数
Function Func(x As Double) As Double
    Func = x * x * x - x * x - 1
End Function

⌨️ 快捷键说明

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