From 1192fb083a591b9590a46710193b8bb8a2a7825a Mon Sep 17 00:00:00 2001 From: Jochen Kiemes Date: Sat, 21 Sep 2024 19:37:33 +0200 Subject: [PATCH] use symbolic constants instead of hardcoded values --- src/PoorManFloat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PoorManFloat.cpp b/src/PoorManFloat.cpp index 266e386d..7822c2a8 100644 --- a/src/PoorManFloat.cpp +++ b/src/PoorManFloat.cpp @@ -250,7 +250,7 @@ uint16_t pmfl_to_u16(pmf_logarithmic x) { return 0; } if (x >= PMF_CONST_UINT16_MAX) { - return 0xffff; + return __UINT16_MAX__; } uint8_t exponent = ((uint16_t)x) >> 9; x &= 0x01ff; @@ -279,7 +279,7 @@ uint32_t pmfl_to_u32(pmf_logarithmic x) { return 0; } if (x >= PMF_CONST_UINT32_MAX) { - return 0xffffffff; + return __UINT32_MAX__; } uint8_t exponent = ((uint16_t)x) >> 9; if (exponent < 0x10) { @@ -293,7 +293,7 @@ uint32_t pmfl_to_u32(pmf_logarithmic x) { } pmf_logarithmic pmfl_square(pmf_logarithmic x) { if (x > 0x4000) { - return 0x7fff; + return PMF_CONST_MAX; } if (x <= -0x4000) { return PMF_CONST_MIN;