From b165b923185d82930314c86ae7fad94b6743bb69 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 18 Jun 2022 19:24:56 -0500 Subject: [PATCH] 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. --- level_0/f_conversion/c/private-conversion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 1.8.3.1