We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 42ca38b + 971f22c commit 35e85bcCopy full SHA for 35e85bc
Maths/AbsoluteValue.java
@@ -18,7 +18,7 @@ public static void main(String[] args) {
18
* @return the absolute value of a number
19
*/
20
public static int absVal(int value) {
21
- return value > 0 ? value : -value;
+ return value < 0 ? -value : value;
22
}
23
24
0 commit comments