Log()

This function calculates the natural log (base e) of the specified number.  The value that is returned is of a type double.  To see an example of how to calculate the log of a base 10 see the snippets section.

Script: 

Sub Main
    Dim MyNumber As Integer
    MyNumber = 15
    MsgBox Log(MyNumber)
End Sub

IDEAScript Language:

Comments

Is it possible to perform Log() with a base other than e?

Brian Element's picture

Yes you can, I found this article that outline it - https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/log-function

So this would be a function to a log 10

Function log10(x)
     log10 = Log(x) / Log(10)
End Function