oh1kh
1
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
erikjo
3
I agree to oh1kh post. It's wrong.
x = abs(-x)
-x = -abs(x)
But the expression in reference manual is just confusing.
system
4
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.