diff --git a/numeric_base.cpp b/numeric_base.cpp index 389fa72..4850588 100644 --- a/numeric_base.cpp +++ b/numeric_base.cpp @@ -1,6 +1,7 @@ #include "includes/numeric_base.hpp" #include #include +#include #include std::string possible_chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; @@ -15,7 +16,7 @@ unsigned int to_decimal(std::string num, int from_base) { compute the value using */ for (int i=0; i < (int)num.length(); i++) { current_char = num.at(i); - index = possible_chars.find(current_char); + index = possible_chars.find(toupper(current_char)); // Convert the character to upper-case, so that the earliest match is detected value += pow(from_base, num.length() - i - 1) * index; }