Fixed toString(double) not picking the closest digits for 17-digit values. (#474)

This commit is contained in:
Branimir Karadžić
2026-10-23 22:29:37 -07:00
committed by GitHub
parent d0ce13617d
commit b366b69f74
2 changed files with 25 additions and 4 deletions
+2
View File
@@ -421,6 +421,8 @@ TEST_CASE("toString double", "[string]")
REQUIRE(testToString(2.225073858507201e-308, "2.225073858507201e-308") );
REQUIRE(testToString(-79.39773355813419, "-79.39773355813419") );
REQUIRE(testToString(-1.234567e-9, "-1.234567e-9") );
REQUIRE(testToString(0.1 + 0.2, "0.30000000000000004") );
REQUIRE(testToString(1.0000000000000002, "1.0000000000000002") );
}
template<typename Ty>