This article will show you how to calculate the absolute value using the ABS() function.
The ABS() function returns the absolute value of a number.
The input and return types we support can be seen in the table below.
✅ The ABS() function returns a value that is the same as the input types.
#Case 1: Basic Absolute
The following example will calculate the absolute value of a negative floating number:
It will return the floating number without the negative value:
#Case 2: Absolute with an expression
The following example calculates the absolute value of an expression i.e., the subtraction operation:
We know that the result of (150 - 250) is -100, but in this case, we’re using an ABS() function to get an absolute number so that the result will ignore the negative value.
Updated 11 May 2023
Did this page help you?