Skip to content

Instantly share code, notes, and snippets.

@mebjas
Created October 5, 2022 10:34
Show Gist options
  • Select an option

  • Save mebjas/0940db2300c793d70e4362ec8be66b0e to your computer and use it in GitHub Desktop.

Select an option

Save mebjas/0940db2300c793d70e4362ec8be66b0e to your computer and use it in GitHub Desktop.
Printing output of difference of exact same values
float a = 100.151f + 0.151f;
float b = 100.101f + 0.201f;
std::cout << "a = " << a << "; b = " << b << "\n";
float diff = a - b;
std::cout << "Diff = " << diff << "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment