Private Sub CMD_CALCULATE_Click Dim result As Double Dim As Double 718

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
Private Sub CMD_CALCULATE_Click()
Dim result As Double
Dim e As Double
e = 2.71828183
For X = 12.22 To 33 Step 2
result = e ^ X + Cotan(Lg(X, e))
TXT_RESULT.Text = TXT_RESULT & "result = " & result & vbCrLf
Next
End Sub
Public Function Cotan(ByVal X As Double) As Double
Cotan = 1 / Tan(X)
End Function
Public Function Lg(ByVal X As Double, ByVal base As Double) As Double
Lg = Log(X) / Log(base)
End Function