Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleCalculate Nth root of a number
Keywordsroot, power, Sqr
CategoriesAlgorithms
 
To calculate the Nth root of K, use the formula:

Exp(Log(K) / N)

 
Private Sub cmdCalculate_Click()
Dim the_root As Double
Dim the_number As Double
Dim the_result As Double

    On Error GoTo CalculateError
    the_root = CDbl(txtRoot.Text)
    the_number = CDbl(txtNumber.Text)
    txtResult.Text = Format$(Exp(Log(the_number) / _
        the_root))
    Exit Sub

CalculateError:
    txtResult.Text = "***"
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated