mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 02:18:35 +00:00
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:
parent
9952f62a33
commit
22cc68808c
@ -254,6 +254,12 @@ void AddFloat(char **buf_p, size_t &maxlen, double fval, int width, int prec, in
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ke::IsInfinite(static_cast<float>(fval)))
|
||||||
|
{
|
||||||
|
AddString(buf_p, maxlen, "Inf", width, prec, flags | NOESCAPE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// default precision
|
// default precision
|
||||||
if (prec < 0)
|
if (prec < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user