-
Does anybody know how to code a program to find the square root of any number I put into a textbox.
I have text1 as the input box
text2 as the answer box
and command1 as the button to find the square root
I also need to know if anybody can make a program to solve for a variable using the same items for like input and that and i want it to solve stuff like
X*5=2x+20-2x
stuff like that
i would like the coding for both but either one is fine if anybody knows how
-
Here's the first part.
Code:
Function CalculateSquareRoot(NumberArg As Double) As Double
If NumberArg < 0 Then ' Evaluate argument.
Exit Function ' Exit to calling procedure.
Else
CalculateSquareRoot = Sqr(NumberArg) ' Return square root.
End If
End Function
-
First question: use either one of the two lines:
MARTY WAS SECONDS FASTER :(
-
X^0.5 works fine too.
Third root:
X^(1/3)
For the second part, i'm just working on a ActiveX Dll that does that.