add brackets to fixed-point conversion_const calculation for clarity

This commit is contained in:
EDiasAlberto
2024-10-15 15:15:16 +01:00
parent 42b0ff9d17
commit 1f1ffe4470

View File

@@ -4,7 +4,7 @@
/* Fixed Point Arithmetic bit count constants */ /* Fixed Point Arithmetic bit count constants */
#define NUM_INT_BITS 11 #define NUM_INT_BITS 11
#define NUM_FRAC_BITS 20 #define NUM_FRAC_BITS 20
#define CONVERSION_CONST 1 << NUM_FRAC_BITS /* f = 2^q, (2^20) */ #define CONVERSION_CONST (1 << NUM_FRAC_BITS) /* f = 2^q, (2^20) */
/* Fixed Point Arithmetic conversion operations */ /* Fixed Point Arithmetic conversion operations */
#define INT_TO_FP(n) ((n) * (CONVERSION_CONST)) #define INT_TO_FP(n) ((n) * (CONVERSION_CONST))