|
|
Title | Calculate Nth root of a number |
Keywords | root, power, Sqr |
Categories | Algorithms |
|
|
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
|
|
|
|
|
|