| 1561 | // Writes the exponent exp in the form "[+-]d{2,3}" to buffer. |
| 1562 | template <typename Char, typename OutputIt> |
| 1563 | FMT_CONSTEXPR auto write_exponent(int exp, OutputIt out) -> OutputIt { |
| 1564 | FMT_ASSERT(-10000 < exp && exp < 10000, "exponent out of range"); |
| 1565 | if (exp < 0) { |
| 1566 | *out++ = static_cast<Char>('-'); |
| 1567 | exp = -exp; |
| 1568 | } else { |
| 1569 | *out++ = static_cast<Char>('+'); |
| 1570 | } |
| 1571 | auto uexp = static_cast<uint32_t>(exp); |
| 1572 | if (is_constant_evaluated()) { |
| 1573 | if (uexp < 10) *out++ = '0'; |
| 1574 | return format_decimal<Char>(out, uexp, count_digits(uexp)); |
| 1575 | } |
| 1576 | if (uexp >= 100u) { |
| 1577 | const char* top = digits2(uexp / 100); |
| 1578 | if (uexp >= 1000u) *out++ = static_cast<Char>(top[0]); |
| 1579 | *out++ = static_cast<Char>(top[1]); |
| 1580 | uexp %= 100; |
| 1581 | } |
| 1582 | const char* d = digits2(uexp); |
| 1583 | *out++ = static_cast<Char>(d[0]); |
| 1584 | *out++ = static_cast<Char>(d[1]); |
| 1585 | return out; |
| 1586 | } |
| 1587 | |
| 1588 | // A floating-point number f * pow(2, e) where F is an unsigned type. |
| 1589 | template <typename F> struct basic_fp { |
nothing calls this directly
no test coverage detected