Quick Question: How to do square root in JAVA?

stso

Platinum Member
Nov 17, 2000
2,528
0
0
I was trying to calculate the circumference for a right triangle, but my instructor did not teach us the method to do the square root.

Here's what I was trying to do.

circumference = base * height + square_root(base * base + height * height);

Someone please help me out. Thanks in advance. :)

edit: oops, sorry I'm talking about circumference :Q
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
I dont know Java, bu this is what I looked up:
java.lang.Math.sqrt(x)



in perl it's just:
sqrt($x);