Skip to content

Commit 09b89b0

Browse files
committed
Bugfix string not printing uint64_t correctly
1 parent 22f2e22 commit 09b89b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

klib/string.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ namespace klib::string::detail {
335335
}
336336
}
337337

338-
while (static_cast<uint32_t>(value) > 0) {
338+
while (static_cast<std::make_unsigned_t<T>>(value) > 0) {
339339
chars += 1;
340340

341341
if constexpr (B == base::BIN) {
@@ -471,7 +471,7 @@ namespace klib::string::detail {
471471
// loop until we dont have any more characters left
472472
for (uint32_t i = 0; i < count; i++) {
473473
// get the remainder
474-
const T remainder = static_cast<uint32_t>(value) % b;
474+
const T remainder = static_cast<std::make_unsigned_t<T>>(value) % b;
475475

476476
// add the letter to the string
477477
if (remainder > 9) {

0 commit comments

Comments
 (0)