1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Fixed abs(), min(), max(), constrain() macros (were incorrectly parenthesized).

This commit is contained in:
David A. Mellis 2006-03-20 22:43:25 +00:00
parent 8d70cfe27b
commit 1c2b95f759

View File

@ -45,10 +45,10 @@ extern "C"{
#define SERIAL 0x0 #define SERIAL 0x0
#define DISPLAY 0x1 #define DISPLAY 0x1
#define min(a,b) ((a<b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b))
#define max(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 constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define radians(deg) ((deg)*DEG_TO_RAD) #define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG) #define degrees(rad) ((rad)*RAD_TO_DEG)
#define sq(x) ((x)*(x)) #define sq(x) ((x)*(x))