We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c79d33 commit 504b528Copy full SHA for 504b528
1 file changed
src/main/java/com/thealgorithms/maths/AbsoluteValue.java
@@ -11,6 +11,6 @@ private AbsoluteValue() {
11
* @return The absolute value of the {@code number}
12
*/
13
public static int getAbsValue(int number) {
14
- return number < 0 ? -number : number;
+ return Math.abs(number);
15
}
16
0 commit comments