Arduino reference ABS(x)

Hi!
This was the site that Reference corrections link moved me.

I think there is an error with abs(x):

Reference Language | Libraries | Comparison | Changes
abs(x)
Description

Computes the absolute value of a number.
Parameters

x: the number
Returns

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

-x: if x is less than 0. <-------------------Here
Warning

Compared to c++ reference: if x is less than 0, means negative number, returns x. (Not -x ! )


Saku

(deleted)

I agree to oh1kh post. It's wrong.

x = abs(-x)
-x = -abs(x)

But the expression in reference manual is just confusing.

Congratulations!
You are the 106th person to bring up this non-error.

Compared to c++ reference: if x is less than 0, means negative number, returns x.

If x is negative, then returning x is obviously the wrong thing to do.

The ultimate proof is to code a test sketch that shows the behavior.