From 4e271ea5aba37229804234bd4a64b86285f1aef4 Mon Sep 17 00:00:00 2001 From: EDiasAlberto Date: Tue, 15 Oct 2024 15:04:26 +0100 Subject: [PATCH] rewrite fixed-point.h to not have magic numbers --- src/threads/fixed-point.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/threads/fixed-point.h b/src/threads/fixed-point.h index 1eb44b3..201ccb4 100644 --- a/src/threads/fixed-point.h +++ b/src/threads/fixed-point.h @@ -4,6 +4,6 @@ /* Fixed Point Arithmetic bit count constants */ #define NUM_INT_BITS 11 #define NUM_FRAC_BITS 20 -#define CONVERSION_CONST 1048576 /* f = 2^q, (2^20) */ +#define CONVERSION_CONST 1 << NUM_FRAC_BITS /* f = 2^q, (2^20) */ #endif //FIXED_POINT_H