mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Fixed abs(), min(), max(), constrain() macros (were incorrectly parenthesized).
This commit is contained in:
@ -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))
|
||||||
|
Reference in New Issue
Block a user