We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22f2e22 commit 09b89b0Copy full SHA for 09b89b0
1 file changed
klib/string.hpp
@@ -335,7 +335,7 @@ namespace klib::string::detail {
335
}
336
337
338
- while (static_cast<uint32_t>(value) > 0) {
+ while (static_cast<std::make_unsigned_t<T>>(value) > 0) {
339
chars += 1;
340
341
if constexpr (B == base::BIN) {
@@ -471,7 +471,7 @@ namespace klib::string::detail {
471
// loop until we dont have any more characters left
472
for (uint32_t i = 0; i < count; i++) {
473
// get the remainder
474
- const T remainder = static_cast<uint32_t>(value) % b;
+ const T remainder = static_cast<std::make_unsigned_t<T>>(value) % b;
475
476
// add the letter to the string
477
if (remainder > 9) {
0 commit comments