From: Kevin Day Date: Sun, 19 Jun 2022 00:24:56 +0000 (-0500) Subject: Update: Use a regular int instead of uint8_t for counting digit in conversion function. X-Git-Tag: 0.5.10~31 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=b165b923185d82930314c86ae7fad94b6743bb69;p=fll Update: Use a regular int instead of uint8_t for counting digit in conversion function. The calculations are based on data.width, which is an int. Make the code more consistent and less error prone by matching the data top. --- diff --git a/level_0/f_conversion/c/private-conversion.c b/level_0/f_conversion/c/private-conversion.c index 248071a..cef2106 100644 --- a/level_0/f_conversion/c/private-conversion.c +++ b/level_0/f_conversion/c/private-conversion.c @@ -91,7 +91,7 @@ extern "C" { f_number_unsigned_t power = 1; f_number_unsigned_t work = 0; - for (register uint8_t i = 1; i < digits; ++i) { + for (register int i = 1; i < digits; ++i) { power *= data.base; } // for @@ -346,7 +346,7 @@ extern "C" { f_number_unsigned_t power = 1; - for (register uint8_t i = 1; i < digits; ++i) { + for (register int i = 1; i < digits; ++i) { power *= data.base; } // for