Don't emit more than precision digits (#1072)
This commit is contained in:
1 parent
3466d9c845
commit
49d244c065
3 files changed
+16
-6
No files matched your search
@@ -1470,6 +1470,10 @@ TEST(FormatterTest, FormatDouble) {
|
||||
EXPECT_EQ(buffer, format("{:A}", -42.0));
|
||||
}
|
||||
|
||||
TEST(FormatterTest, PrecisionRounding) {
|
||||
EXPECT_EQ("0.000", format("{:.3f}", 0.00049));
|
||||
}
|
||||
|
||||
TEST(FormatterTest, FormatNaN) {
|
||||
double nan = std::numeric_limits<double>::quiet_NaN();
|
||||
EXPECT_EQ("nan", format("{}", nan));
|
||||
|
||||
Reference in new issue
Block a user