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

This commit is contained in:
F1F88
2026-04-22 16:54:05 +02:00
committed by GitHub
parent 1bc536fdfa
commit 81ebd8cf8d
+2 -1
View File
@@ -269,7 +269,8 @@ void AddFloat(char **buf_p, size_t &maxlen, double fval, int width, int prec, in
if (ke::IsInfinite(static_cast<float>(fval)))
{
AddString(buf_p, maxlen, "Inf", width, prec, flags | NOESCAPE);
const char *str = ((fval < 0) ? "-Inf" : "Inf");
AddString(buf_p, maxlen, str, width, prec, flags | NOESCAPE);
return;
}