Skip to content

Commit 80ce3cf

Browse files
committed
v3.2.1
1 parent 9b49879 commit 80ce3cf

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

src/LO Basic/VBAExpressionsLib/VBAexpressions.xba

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3399,32 +3399,18 @@ err_Handler:
33993399
d_lParenthesis & err.Description & d_rParenthesis
34003400
End Function
34013401

3402-
Private Function fZero(ByRef aFunction As String, ByVal A As Double, _
3403-
ByVal B As Double, Optional epsilon As Double = 0.0000000001, _
3404-
Optional includeVarNames As Boolean = True, _
3405-
Optional useBisectionMethod As Boolean = False, _
3406-
Optional printDebugINFO As Boolean = False) As String
3407-
If Not useBisectionMethod Then
3408-
fZero = fZeroMRF(aFunction, A, B, epsilon, includeVarNames, printDebugINFO)
3409-
Else
3410-
fZero = fZeroMBM(aFunction, A, B, epsilon, includeVarNames, printDebugINFO)
3411-
End If
3412-
End Function
3413-
34143402
''' <summary>
34153403
''' Finds a zero of a univariate function ussing a modified bisection method.
34163404
''' aFunction must be a continuous function f(x) for the interval a <= x <= b.
34173405
''' </summary>
34183406
''' <param name="aFunction">Inline function.</param>
34193407
''' <param name="a">Leftmost interval value.</param>
34203408
''' <param name="b">Rightmost interval value.</param>
3421-
''' <param name="epsilon">Tolerance (relative error limit).</param>
34223409
''' <param name="IncludeVarNames">Include variable name in result.</param>
3423-
''' <param name="printDebugINFO">Print information like iteraction count.</param>
3410+
''' <param name="epsilon">Tolerance (relative error limit).</param>
34243411
Private Function fZeroMBM(ByRef aFunction As String, ByVal A As Double, _
3425-
ByVal B As Double, Optional epsilon As Double = 0.0000000001, _
3426-
Optional includeVarNames As Boolean = True, _
3427-
Optional printDebugINFO As Boolean = False) As String
3412+
ByVal B As Double, Optional includeVarNames As Boolean = True, _
3413+
Optional epsilon As Double = 0.0000000001) As String
34283414
Dim absFC As Double, absFD As Double
34293415
Dim aZero As Double
34303416
Dim c As Double, d As Double 'Intermediate points |a---:c:----:d:---b|
@@ -3516,7 +3502,7 @@ Private Function fZeroMBM(ByRef aFunction As String, ByVal A As Double, _
35163502
.LetVarValue(tmpVar(varIdx), tmpResult)
35173503
If Round(tmpFzeroEval, Len(CStr(1 / aZero)) - 1) = 0 Then
35183504
If includeVarNames Then
3519-
fZeroMBM = .CurrentVarValues
3505+
fZeroMBM = ToLiteralString(.CurrentVarValues)
35203506
Else
35213507
fZeroMBM = tmpResult
35223508
End If
@@ -3526,9 +3512,6 @@ Private Function fZeroMBM(ByRef aFunction As String, ByVal A As Double, _
35263512
End With
35273513
fZeroMBM_terminate:
35283514
Set fEvalHelper = Nothing
3529-
If printDebugINFO Then
3530-
'Debug.Print "fZeroMBM: " & vbCrLf & vbTab & vbTab & "Evaluations:"; evalCounter; "; Iteractions:"; k
3531-
End If
35323515
Exit Function
35333516
fZeroMBM_errHandler:
35343517
fZeroMBM = e_ValueError

0 commit comments

Comments
 (0)