How do I get square roots in vb?!!!! I've have been trying all day but can't find an equation! :mad: Please help. Thanks guys!
Printable View
How do I get square roots in vb?!!!! I've have been trying all day but can't find an equation! :mad: Please help. Thanks guys!
Sqr(number)
where "number" is the number you want the square root of.
This is how I do it using VB6
ARG!!!!!!!!! YOU'RE KIDDING!!!!!!!!!!!!!!! JUST SQR(number)??????????????????????? oh boy! I tried sqrt! Thank you sooooooooooooooooooo much! :D :D :D :D :D :D
If you ever find there is no sqrt function in some language you are using, just remember your Math from school.
To use logarithms, useCode:sqrt = x ^ (1/2)
only this is less accurate than the first example.Code:sqrt = exp(log(x)/2)
hehe
This way you will know how to work out the nth root of any number in code...
Regards
Paul Lewis
hey steve, namezero has done something to ur web site
Uh Oh! Damn namezero! Well my new homepage is this: http://www.geocities.com/stephenmack23/index.html
thanks da_silvey!
sqrt = x ^ (1/2)
oh boy...a kid reccomended that but i heard wrong and tried squrt = x ^ -2
Thanks so much guys! :D (we are in ch 4 in school, square roots was hidden in ch 8)
What book? (Oh yeah - age/grade?)
Im a freshman in high school, Im 14 :) The books name is.....drumroll.....An Introduction to Programming Using Microsoft Visual Basic Versions 5 & 6 . It sounds very basic but it goes from how to use windows to databases and stuff. Good book :D