Skip to content

Commit ed84a71

Browse files
committed
Update VBAexpressions.cls
1 parent 6637dcf commit ed84a71

File tree

1 file changed

+3
-49
lines changed

1 file changed

+3
-49
lines changed

src/VBAexpressions.cls

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ Option Base 0
4949
' List = ["{"] ["{"] SubExpr [{";" SubExpr}] ["}"] ["}"]
5050
' Unary = "-" | "+" | ~
5151
' Literal = (Operand | "'"Alphabet"'")
52-
' Operand = ({Digit} ["."] [{Digit}] ["E"("-" | "+"){Digit}] | (True | False))
52+
' Operand = ({Digit} [Decimal] [{Digit}] ["E"("-" | "+"){Digit}] | (True | False))
5353
' Variable = Alphabet [{Decimal}] [{(Digit | Alphabet)}]
5454
' Alphabet = "A-Z" | "a-z"
55-
' Decimal = "."
55+
' Decimal = "." | ","
5656
' Digit = "0-9"
5757
' Operator = "+" | "-" | "*" | "/" | "\" | "^" | "%" | "!" | "<" | "<=" | "<>" | ">" | ">=" | "=" | "$" | "&" | "|" | "||"
5858
' Function = "abs" | "sin" | "cos" | "min" |...|[UDF]
@@ -3372,52 +3372,6 @@ err_Handler:
33723372
d_lParenthesis & err.Description & d_rParenthesis
33733373
End Function
33743374

3375-
''' <summary>
3376-
''' Finds roots of a univariate function ussing the bisection method.
3377-
''' at the interval a <= x <= b.
3378-
''' </summary>
3379-
''' <param name="aFunction">Inline function.</param>
3380-
''' <param name="a">Leftmost interval value.</param>
3381-
''' <param name="b">Rightmost interval value.</param>
3382-
''' <param name="inc">Increment used in calculations.</param>
3383-
''' <param name="epsilon">Tolerance (relative error limit).</param>
3384-
Public Function fRoots(ByRef aFunction As String, A As Double, _
3385-
B As Double, Optional inc As Double = 1, _
3386-
Optional epsilon As Double = 0.0000000001) As String
3387-
Dim tmpRoot As String
3388-
Dim tmpResult As String
3389-
Dim lx As Double, ux As Double
3390-
3391-
If inc <> 1 Then
3392-
inc = Abs(inc)
3393-
End If
3394-
If A > B Then
3395-
fRoots = e_ValueError
3396-
Exit Function
3397-
End If
3398-
tmpRoot = fZero(aFunction, A, B, epsilon, False)
3399-
If tmpRoot <> e_ValueError Then 'Function with at least one root
3400-
lx = A
3401-
ux = A + inc
3402-
Do While ux <= B
3403-
On Error Resume Next
3404-
tmpRoot = fZeroMBM(aFunction, lx, ux, epsilon, False)
3405-
If tmpRoot <> e_ValueError Then
3406-
If tmpResult <> vbNullString Then
3407-
tmpResult = tmpResult & "; " & tmpRoot
3408-
Else
3409-
tmpResult = tmpRoot
3410-
End If
3411-
End If
3412-
lx = lx + inc
3413-
ux = ux + inc
3414-
Loop
3415-
fRoots = d_lCurly & tmpResult & d_rCurly
3416-
Else
3417-
fRoots = tmpRoot
3418-
End If
3419-
End Function
3420-
34213375
Private Function FV_(ByRef expression As String, ByRef fName As String) As String
34223376
Dim argsCount As Long
34233377
Dim tmpData() As String
@@ -4940,7 +4894,7 @@ err_Handler:
49404894
d_lParenthesis & err.Description & d_rParenthesis
49414895
End Function
49424896

4943-
Public Function iBETAINV(p As Double, A As Double, B As Double) As Double
4897+
Private Function iBETAINV(p As Double, A As Double, B As Double) As Double
49444898
Const EPS As Double = 0.00000001
49454899
Dim aL As Double
49464900
Dim a1, b1 As Double

0 commit comments

Comments
 (0)