posted 19 years ago
Other than using Math.sqrt(x) instead of Math.pow(x, 0.5), my only suggestion is to post more of your code. I just coded up a solution using your formula and it worked. Well, I didn't verify the areas, but it prints zero only when I expect it (a + b == c, which is an empty triangle).
So to recap.
Use Math.sqrt()Post more of your codePost output from a run that demonstrates failure, preferably with printlns of your sides and permeter (any intermediate calculations)