The math.fabs() function returns the absolute value of a number.
The absolute value of a given number, is the number's distance from zero. So for example, the absolute value of 6 is 6, and the absolute value of -6 is also 6, since they are both 6 units away from zero.
math.fabs(x)
Where, x is the number whose absolute value is to be determined.
The function returns the absolute value of x as a floating point value.
As shown above, the absolute value of a positive number is equal to the number itself, while the absolute value of a negative number is equal to its positive counterpart.