Skip to content

Commit

Permalink
use symbolic constants instead of hardcoded values
Browse files Browse the repository at this point in the history
  • Loading branch information
gin66 committed Sep 21, 2024
1 parent f3de56d commit 1192fb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/PoorManFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 1192fb0

Please sign in to comment.