MCPcopy Create free account
hub / github.com/TheAlgorithms/Java / AbsoluteValue

Class AbsoluteValue

src/main/java/com/thealgorithms/maths/AbsoluteValue.java:3–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1package com.thealgorithms.maths;
2
3public final class AbsoluteValue {
4 private AbsoluteValue() {
5 }
6
7 /**
8 * Returns the absolute value of a number.
9 *
10 * @param number The number to be transformed
11 * @return The absolute value of the {@code number}
12 */
13 public static int getAbsValue(int number) {
14 return Math.abs(number);
15 }
16}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected