-
Notifications
You must be signed in to change notification settings - Fork 864
Closed
Description
Hi,
I think this statement is wrong: side1 + side2 > side3 || side1 + side3 > side2 || side2 + side3 > side1;
for example take the sides as follow: side1 == 5, side2 == 21 and side3 == 6, there is no way to compute this value, even though the boolean isValid method, evaluates to true, which should evaluates to false!
I think this is the right statement: side1 + side2 > side3 && side1 + side3 > side2 && side2 + side3 > side1;
btw, this method could be written as follow too:
public static boolean isValid(double side1, double side2, double side3) {
return side1 + side2 > side3 && side1 + side3 > side2 && side2 + side3;
}
Metadata
Metadata
Assignees
Labels
No labels