Arduino Reference Page for abs()

On the reference page for abs() function , ( ) it says:


x: if x is greater than or equal to 0.

-x: if x is less than 0.

If I am not missing anything, shouldn't abs always return positive 'x'. This has already been discussed earlier at .

Has the change skipped attention or am I reading it in-correctly?


shouldn't abs always return positive 'x'.

It does. As has been pointed out before, if x is, for example, -5 then x is less than zero and so abs(x) returns -x which is 5.


Oh yes. Makes sense.

[Late night readings are not good.] ;)