# Documentation for ABS function is confusing

Hello.

It says the ABS function will return:

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

-x: if x is less than 0.

This is a bit unclear! Now, I realise that if x is negative, then -x is positive, but not everyone will so this is a bit too confusing.

Why not simply say:

The abs(x) function returns the absolute value of x, that is to say it returns x without the sign.

and provide some examples :

x= 4.5 returns 4.5
x= -3.2 returns 3.2
x= 0 returns 0

Hope that can be updated.

Warmest regards,

Brian

Well firstly, your chance of having anything in the tutorials/ references altered, is close to |x| = -(x2).

However the definition

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

-x: if x is less than 0.

is actually entirely accurate in terms of the functionâ€™s implementation.

You're not the first to (incorrectly IMO) report this one. ;)

Hello,

bcraigie: Hope that can be updated. :-)

Create an issue here... https://github.com/arduino/reference-en/issues

Optionally...

Fork the repository... https://github.com/arduino/reference-en

Commit the change. Create a pull request.