diff options
Diffstat (limited to 'wirish')
-rw-r--r-- | wirish/include/wirish/wirish_math.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wirish/include/wirish/wirish_math.h b/wirish/include/wirish/wirish_math.h index 39f16a0..ff264dc 100644 --- a/wirish/include/wirish/wirish_math.h +++ b/wirish/include/wirish/wirish_math.h @@ -93,7 +93,8 @@ static inline long map(long value, long fromStart, long fromEnd, #define min(a,b) ((a)<(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b)) #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 round(x) ((x)>=0?(long)((x)+(double)0.5):(long)((x)-(double)0.5)) +#define roundf(x) ((x)>=0?(long)((x)+(float)0.5):(long)((x)-(float)0.5)) #define radians(deg) ((deg)*DEG_TO_RAD) #define degrees(rad) ((rad)*RAD_TO_DEG) #define sq(x) ((x)*(x)) |