# How to code mathematical function "ln" in VB?

Hi experts,
I want to write a formula in VB and my formula contain mathematical function "ln" .. i just don't know how to code it in VB..
i know for "log".. just put something like log(2).. but cannot with "ln"..

thanks
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
In is a reserved word in VB + SQL
Can you give an example of what context you wish to use it?
Commented:
ln is natural log.

log() fn in vb is natural log itself.

so u can use it.

if u want log to the base 10, do a log(x)/log(10)

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
log is ln in VB.

log(e)=1
Commented:
The closest thing to IN would be a case statement

select case (val)
case  1 to 15: do something
case 20,30,40,50: do something else
case else:  not "IN" above"
end select

I know it's not exactly math, but it works as a replacemet.
ie "IF x in {1,5,34,34,36 } can translate to

if x = 1  or x=5 or x=34 or x=36 then
do something
end if

(or)

select case x
case 1,5,34,34,36 : do something

hope that helps!
Commented:
The closest thing to IN would be a case statement

select case (val)
case  1 to 15: do something
case 20,30,40,50: do something else
case else:  not "IN" above"
end select

I know it's not exactly math, but it works as a replacemet.
ie "IF x in {1,5,34,34,36 } can translate to

if x = 1  or x=5 or x=34 or x=36 then
do something
end if

(or)

select case x
case 1,5,34,34,36 : do something
end select

hope that helps!
Commented:
no spec. grudges, but why did u opt for grade B.?
as in, i thot the answer was total.
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.