Supports "%f" formatting value as inf float (#2324)

* Fixed when the float value of "%f" is inf, it should be formatted as "Inf" instead of "0.0"

* Replace std::isinf with ke::IsInfinite
This commit is contained in:
F1F88
2025-11-08 16:32:09 +00:00
committed by GitHub
parent 9952f62a33
commit 22cc68808c
+6
View File
@@ -254,6 +254,12 @@ void AddFloat(char **buf_p, size_t &maxlen, double fval, int width, int prec, in
return;
}
if (ke::IsInfinite(static_cast<float>(fval)))
{
AddString(buf_p, maxlen, "Inf", width, prec, flags | NOESCAPE);
return;
}
// default precision
if (prec < 0)
{