If you programming language has functions like max - min, it's easy to do it in that way
def abs(a, b): return max(a, b) - min(a, b)