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
1 changed files with 4 additions and 4 deletions

View File

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