diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index 91eeb16bc..432882f16 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -91,7 +91,7 @@ void yield(void); #define min(a,b) ((a)<(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b)) -#define abs(x) ((x)>0?(x):-(x)) +#define abs(x) ((x)>=0?(x):-(x)) #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) #define radians(deg) ((deg)*DEG_TO_RAD)