mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 00:21:13 +00:00
Minor cleanup
This commit is contained in:
parent
9660ea1bff
commit
83808076e3
@ -1388,13 +1388,8 @@ typename buffer_context<Char>::type::iterator vformat_to(
|
||||
fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23));
|
||||
\endrst
|
||||
*/
|
||||
template <typename T>
|
||||
inline internal::named_arg<T, char> arg(string_view name, const T& arg) {
|
||||
return {name, arg};
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline internal::named_arg<T, wchar_t> arg(wstring_view name, const T& arg) {
|
||||
template <typename S, typename T>
|
||||
inline internal::named_arg<T, FMT_CHAR(S)> arg(const S& name, const T& arg) {
|
||||
return {name, arg};
|
||||
}
|
||||
|
||||
|
@ -419,12 +419,6 @@ inline fp operator-(fp x, fp y) {
|
||||
// Computes an fp number r with r.f = x.f * y.f / pow(2, 64) rounded to nearest
|
||||
// with half-up tie breaking, r.e = x.e + y.e + 64. Result may not be
|
||||
// normalized.
|
||||
FMT_API fp operator*(fp x, fp y);
|
||||
|
||||
// Returns cached power (of 10) c_k = c_k.f * pow(2, c_k.e) such that its
|
||||
// (binary) exponent satisfies min_exponent <= c_k.e <= min_exponent + 3.
|
||||
FMT_API fp get_cached_power(int min_exponent, int& pow10_exponent);
|
||||
|
||||
FMT_FUNC fp operator*(fp x, fp y) {
|
||||
// Multiply 32-bit parts of significands.
|
||||
uint64_t mask = (1ULL << 32) - 1;
|
||||
@ -436,6 +430,8 @@ FMT_FUNC fp operator*(fp x, fp y) {
|
||||
return fp(ac + (ad >> 32) + (bc >> 32) + (mid >> 32), x.e + y.e + 64);
|
||||
}
|
||||
|
||||
// Returns cached power (of 10) c_k = c_k.f * pow(2, c_k.e) such that its
|
||||
// (binary) exponent satisfies min_exponent <= c_k.e <= min_exponent + 28.
|
||||
FMT_FUNC fp get_cached_power(int min_exponent, int& pow10_exponent) {
|
||||
const double one_over_log2_10 = 0.30102999566398114; // 1 / log2(10)
|
||||
int index = static_cast<int>(
|
||||
|
Loading…
Reference in New Issue
Block a user