Open duffy-ocraven opened 3 years ago
A reproducer is
diff --git a/tinyformat_test.cpp b/tinyformat_test.cpp
index 4bb1d60..3e85007 100644
--- a/tinyformat_test.cpp
+++ b/tinyformat_test.cpp
@@ -222,6 +222,7 @@ int unitTests()
CHECK_EQUAL(tfm::format("%.3d", std::numeric_limits<double>::quiet_NaN()), "nan");
CHECK_EQUAL(tfm::format("%.4d", std::numeric_limits<double>::quiet_NaN()), " nan");
CHECK_EQUAL(tfm::format("%04.0f", std::numeric_limits<double>::quiet_NaN()), " nan");
+ CHECK_EQUAL(tfm::format("%.5d", -std::numeric_limits<double>::infinity()), " -inf");
# endif
//------------------------------------------------------------
which fails with
test failed, line 225
- inf != -inf
[tfm::format("%.5d", -std::numeric_limits<double>::infinity()), " -inf"]
Before #77 change gets widely circulated, check whether passing the negative -INF through %.16d still puts the minus sign at far-left