Skip to Content

The absolute function abs() accepts a number as its sole parameter and returns the positive value of that number.

For example, abs(10) will return 10 as the number passed in as its parameter is already positive, but abs(-10) will return 10 as the number passed in is a negative number.

Using the abs() function is useful when you want to calculate the distance between two items and are not concerned about the position.