How do you use the LN function that is found on a Business Calculator in Visual Basic?
I need to know how call a function in Visual Basic that does the same thing as the LN button on a business calculator. I found the following on this site:
Private Function Ln(ByVal Number As Double) As Double
Ln = Log(Number) / Log(Exp(1))
End Function
I get errors stating that the Log and Exp portions have not been declared. I thought that these were built-in function of VB?
My other part of my code calls this function as follows:
'Now Call the function that performs the LN portion on a calculator
Dim dblLN1, dblLN2 As Double
Log(Double) Returns the natural (base e) logarithm of a specified number.
Log(Double, Double) Returns the logarithm of a specified number in a specified base.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
BIGELOJ
ASKER
If LOG() in VB is natural logarithm then why is it asking me to declare it as a variable and it is not listed when I try to select it. Please see the Image. LN.JPG