Solved

How to code mathematical function "ln" in VB?

Posted on 2003-12-03
6
2,799 Views
Last Modified: 2010-05-18
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
0
Comment
Question by:michelle_branch
6 Comments
 
LVL 2

Expert Comment

by:diarmaid
ID: 9865369
In is a reserved word in VB + SQL
Can you give an example of what context you wish to use it?
0
 
LVL 7

Accepted Solution

by:
_agj_ earned 40 total points
ID: 9865752
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)
0
 
LVL 1

Expert Comment

by:JonGartzia
ID: 9866048
log is ln in VB.

log(e)=1
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

by:enari
ID: 9869068
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!
0
 

Expert Comment

by:enari
ID: 9869142
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!
0
 
LVL 7

Expert Comment

by:_agj_
ID: 9873016
no spec. grudges, but why did u opt for grade B.?
as in, i thot the answer was total.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now