Natural Log Function ( LN )

K

Kit Truong

Hello,

I'm using Access 2000 and I'm trying to use the natural logarithm function
( ln ) in one of my modules but one doesn't exist.

Does anyone know or have a function that uses the existing Math.log/exp
functions to get the equivalent ln function?

Thanks.
 
K

Ken Snell [MVP]

VBA's Log function is the natural logarithm.

From ACCESS Help File:

Log Function
Returns a Double specifying the natural logarithm of a number.

Syntax
Log(number)

The required number argument is a Double or any valid numeric expression
greater than zero.

Remarks
The natural logarithm is the logarithm to the base e. The constant e is
approximately 2.718282.
You can calculate base-n logarithms for any number x by dividing the
natural logarithm of x by the natural logarithm of n as follows:
Logn(x) = Log(x) / Log(n)

The following example illustrates a custom Function that calculates
base-10 logarithms:
Static Function Log10(X)
Log10 = Log(X) / Log(10#)
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top