mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
17 lines
371 B
Java
17 lines
371 B
Java
package com.thealgorithms.maths;
|
|
|
|
public final class AbsoluteValue {
|
|
private AbsoluteValue() {
|
|
}
|
|
|
|
/**
|
|
* Returns the absolute value of a number.
|
|
*
|
|
* @param number The number to be transformed
|
|
* @return The absolute value of the {@code number}
|
|
*/
|
|
public static int getAbsValue(int number) {
|
|
return Math.abs(number);
|
|
}
|
|
}
|