The absolute value of a real number x, often written |x| in mathematics or abs(x) in various programming languages is x if x>=0, and -x if x < 0.