25 if (value.size() > 2 && value[0] ==
'0' && toupper(value[1]) ==
'X') {
29 static std::string const hexallowed(
"0123456789ABCDEFabcdef");
31 for (; it != end && hexallowed.find(*it) != std::string::npos; ++it)
32 hex.append(1, toupper(*it));
41 dec = base_converter::hex_to_dec(hex);
52 if (value.size() > 2 && value[0] ==
'0' && toupper(value[1]) ==
'B') {
58 for (; it != end && binallowed.find(*it) != std::string::npos; ++it)
68 dec = base_converter::bin_to_dec(bin);
80 if (*it ==
'+' || *it ==
'-')
85 for (; it != end && std::isdigit(*it); ++it)
90 if (it != end && *it ==
'.') {
91 while (++it != end && std::isdigit(*it))
92 fraction.append(1, *it);
97 if (it != end && (*it ==
'E' || *it ==
'e')) {
100 if (*it ==
'+' || *it ==
'-') {
105 for (; it != end && std::isdigit(*it); ++it)
106 exponent.append(1, *it);
117 std::size_t ndig = digits.size();
120 long exp = std::atoi(exponent.c_str()) + whole.size();
123 while (ndig > 1 && digits[ndig - 1] ==
'0')
124 digits.erase(--ndig, 1);
126 for (; ndig > 1 && digits[0] ==
'0'; --exp, --ndig)
131 result.append(digits);
135 if (
long(ndig) <= exp && exp <= 6L) {
136 result.append(digits).append(exp - ndig,
'0');
139 digits.insert(digits.begin() + 1,
'.');
141 result.append(digits);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
bool canonical_number(std::string const &value, std::string &result)
QTextStream & hex(QTextStream &s)
QTextStream & dec(QTextStream &s)
QTextStream & bin(QTextStream &s)
std::string to_string(ModuleType const mt)