Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format functions #2110

Open
0x00000ED opened this issue Feb 2, 2024 · 0 comments
Open

format functions #2110

0x00000ED opened this issue Feb 2, 2024 · 0 comments

Comments

@0x00000ED
Copy link

0x00000ED commented Feb 2, 2024

Description

Why all functions that have a format argument dont indicate that the number is infinite?

Problematic Code (or Steps to Reproduce)

public void OnPluginStart()
{
  float nan = 0.0/0.0;
  float inf = 1.0/0.0;

  PrintToServer("PrintToServer %f %f %f", nan, inf, -inf);

  char buff[128];
  Format(buff, sizeof(buff), "Format %f %f %f", nan, inf, -inf);
  PrintToServer("%s", buff);

  char fts1[10];
  FloatToString(nan, fts1, sizeof(fts1));
  char fts2[10];
  FloatToString(inf, fts2, sizeof(fts2));
  char fts3[10];
  FloatToString(-inf, fts3, sizeof(fts3));

  PrintToServer("FloatToString %s %s %s", fts1, fts2, fts3);
}

Logs

// PrintToServer NaN 0.000000 -0.000000
// Format NaN 0.000000 -0.000000
// FloatToString -nan(ind) inf -inf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant