fix bracketing issue in ROUNDING_FP_TO_INT
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
/* Handles conversion of fixed point to integer. First version truncates, second one rounds */
|
/* Handles conversion of fixed point to integer. First version truncates, second one rounds */
|
||||||
#define FLOOR_FP_TO_INT(x) ((x) / (CONVERSION_CONST))
|
#define FLOOR_FP_TO_INT(x) ((x) / (CONVERSION_CONST))
|
||||||
#define ROUNDING_FP_TO_INT(x) ((x) >= 0 ? ((x) + ((CONVERSION_CONST) / 2)) : ((x) - ((CONVERSION_CONST) / 2))
|
#define ROUNDING_FP_TO_INT(x) ((x) >= 0 ? ((x) + ((CONVERSION_CONST) / 2)) : ((x) - ((CONVERSION_CONST) / 2)))
|
||||||
|
|
||||||
/* Fixed Point Arithmetic addition operations */
|
/* Fixed Point Arithmetic addition operations */
|
||||||
#define FP_ADD(x, y) ((x) + (y))
|
#define FP_ADD(x, y) ((x) + (y))
|
||||||
|
|||||||
Reference in New Issue
Block a user