Skip to content

Commit

Permalink
Test full exponent range
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Aug 18, 2024
1 parent 94b8bc8 commit 62382e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/format-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,11 @@ TEST(format_test, runtime_width) {
EXPECT_EQ(fmt::format("{:{}}", 42, short(4)), " 42");
}

TEST(format_test, exponent_range) {
for (int e = -1074; e <= 1023; ++e)
(void)fmt::format("{}", std::ldexp(1, e));
}

TEST(format_test, precision) {
char format_str[buffer_size];
safe_sprintf(format_str, "{0:.%u", UINT_MAX);
Expand Down

0 comments on commit 62382e3

Please sign in to comment.