The abs() function is used to find and return the absolute value (magnitude) of an integer. It disregards any negative sign attached to it and always gives back its positive equivalent.
Related terms
max(int a, int b): This method returns the larger of two given integers.
min(int a, int b): This method returns the smaller of two given integers.
random(): This method generates a random number between 0.0 (inclusive) and 1.0 (exclusive).