Fix handling of subnormals in exotic FP

This commit is contained in:
Victor Zverovich
2022-04-17 08:12:38 -07:00
parent 86e27ccb41
commit 5d804ee7fe
2 changed files with 7 additions and 8 deletions

View File

@@ -1009,6 +1009,8 @@ TEST(format_test, precision) {
if (std::numeric_limits<long double>::digits == 64) {
auto ld = (std::numeric_limits<long double>::min)();
EXPECT_EQ(fmt::format("{:.0}", ld), "3e-4932");
EXPECT_EQ(fmt::format("{:0g}", 5.02957084971264961283E-4940L),
"5.02957e-4940");
}
EXPECT_EQ("123.", fmt::format("{:#.0f}", 123.0));