I was looking at my calculator and saw the abs() function to which I thought, this function is fairly unnecessary. So I suppose my question is: is abs(x) different from sqrt(x^2) in some way? If they are not different, why is it so common to see abs(x) function on calculators and in programming languages etc.?
Thanks!
First, abs() just removes the sign from the number, which is computationally a LOT less expensive than squaring and the extracting the square root. Second, extracting square roots causes round off error.