diff options
| author | Martin Hořeňovský | 2024-04-30 16:43:05 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2024-04-30 17:18:48 +0200 |
| commit | ef713582d268d9b1b15381325021d7e0f91d6ab9 (patch) | |
| tree | bb9f73173f9ad2a4fc4c1dd56080a7f50fb5f702 /tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp | |
| parent | efb39689d94e43132e4e48f01e676ae6a56d8df6 (diff) | |
| download | catch3-ef713582d268d9b1b15381325021d7e0f91d6ab9.tar.gz | |
Default StringMaker<FloatingPointType>::precision to max_digits10
`max_digits10` is the number of decimal digits that the type _can_
represent, in other words, the number of decimal digits needed to
disambiguate any two floating point numbers when serialized to
a string.
Diffstat (limited to 'tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp')
| -rw-r--r-- | tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp b/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp index e073a40a..78c0c80a 100644 --- a/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp +++ b/tests/SelfTest/UsageTests/ToStringGeneral.tests.cpp @@ -124,8 +124,8 @@ TEST_CASE("Precision of floating point stringification can be set", "[toString][ const auto oldPrecision = sm::precision; const float testFloat = 1.12345678901234567899f; - auto str1 = sm::convert(testFloat); sm::precision = 5; + auto str1 = sm::convert( testFloat ); // "1." prefix = 2 chars, f suffix is another char CHECK(str1.size() == 3 + 5); |