Calculating LN( ) within VBA

S

Stratis

Is there any way to calculate the natural log (LN() in
excel) of a number using VBA within Access? I can do Log
() but I can't fine LN().

thanks
Stratis
 
D

Douglas J. Steele

Actually, the Log function in VBA gives you the natural log, not the base 10
log.

As it says in the Help file, 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