Eliminate extra copy on floating-point formatting

This commit is contained in:
Victor Zverovich
2019-02-06 07:49:19 -08:00
parent 9989e7f4e3
commit 5a314a5288
5 changed files with 131 additions and 140 deletions

View File

@@ -102,7 +102,8 @@ TEST(FPTest, GetCachedPower) {
TEST(FPTest, Grisu2FormatCompilesWithNonIEEEDouble) {
fmt::memory_buffer buf;
grisu2_format(4.2f, buf, fmt::core_format_specs());
int exp = 0;
grisu2_format(4.2f, buf, fmt::core_format_specs(), exp);
}
template <typename T> struct ValueExtractor : fmt::internal::function<T> {

View File

@@ -51,5 +51,4 @@ TEST(GrisuTest, Prettify) {
EXPECT_EQ("12340000000.0", fmt::format("{}", 1234e7));
EXPECT_EQ("12.34", fmt::format("{}", 1234e-2));
EXPECT_EQ("0.001234", fmt::format("{}", 1234e-6));
}