Arduino Reference Page for abs()

On the reference page for abs() function , ( https://www.arduino.cc/en/Reference/Abs ) it says:

Returns

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 Arduino Reference - abs() - Website and Forum - Arduino Forum .

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

Amitabh

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.

Pete

Oh yes. Makes sense.

[Late night readings are not good.] :wink: