Solved

2 easy ones

Posted on 2002-05-27
4
136 Views
Last Modified: 2010-05-02

I'm moving and my office is all in boxes so I have no access to the help files.

First what is the syntax for the natural log function in VB and second how do I raise a variable to a power. For example X raised to the power of 3.


Thanks
0
Comment
Question by:bfeddish
  • 3
4 Comments
 
LVL 18

Accepted Solution

by:
Crash2100 earned 75 total points
ID: 7037238
'To raise a variable to a power use the ^ for the exponent
x = y^3


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

Syntax

Log(number)

The required numberargument is aDouble or any validnumeric expression greater than zero.

Remarks

The natural logarithm is the logarithm to the base e. Theconstant 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




Exp Function
------------
Returns a Double specifying e (the base of natural logarithms) raised to a power.

Syntax

Exp(number)

The required numberargument is aDouble or any validnumeric expression.

Remarks

If the value of number exceeds 709.782712893, an error occurs. Theconstant e is approximately 2.718282.

Note   The Exp function complements the action of the Log function and is sometimes referred to as the antilogarithm.

0
 
LVL 18

Expert Comment

by:Crash2100
ID: 7037246
You can also look this stuff up on microsoft's online version of msdn:
http://msdn.microsoft.com/library/default.asp
0
 
LVL 1

Author Comment

by:bfeddish
ID: 7037262

Thanks for the quick answer.

Bryan
0
 
LVL 18

Expert Comment

by:Crash2100
ID: 7037280
glad i could help
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 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