Prevent overflow with zero precision
This commit is contained in:
1 parent
49bbf3c876
commit
e28429ee73
2 files changed
+12
-6
No files matched your search
@@ -1471,6 +1471,7 @@ TEST(FormatterTest, FormatDouble) {
|
||||
}
|
||||
|
||||
TEST(FormatterTest, PrecisionRounding) {
|
||||
EXPECT_EQ("0", format("{:.0f}", 0.1));
|
||||
EXPECT_EQ("0.000", format("{:.3f}", 0.00049));
|
||||
EXPECT_EQ("0.001", format("{:.3f}", 0.0005));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user