| 1459 | |
| 1460 | template <typename UC> |
| 1461 | fastfloat_really_inline constexpr uint8_t ch_to_digit(UC c) { |
| 1462 | // wchar_t and char can be signed, so we need to be careful. |
| 1463 | using UnsignedUC = typename std::make_unsigned<UC>::type; |
| 1464 | return int_luts<>::chdigit[static_cast<unsigned char>( |
| 1465 | static_cast<UnsignedUC>(c) & |
| 1466 | static_cast<UnsignedUC>( |
| 1467 | -((static_cast<UnsignedUC>(c) & ~0xFFull) == 0)))]; |
| 1468 | } |
| 1469 | |
| 1470 | fastfloat_really_inline constexpr size_t max_digits_u64(int base) { |
| 1471 | return int_luts<>::maxdigits_u64[base - 2]; |