OP_ABS takes the top item on the stack and replaces it with its absolute value. This operation is crucial in scripts where only the magnitude of a number matters, irrespective of its sign, such as in scripts comparing distances, differences, or other calculations where direction or sign is irrelevant.
OP_Code Walkthrough
Absolute value of the top item of the stack
Pop Top Item
Compute absolute value of item
Push Item