Skip to content

Instantly share code, notes, and snippets.

@ilpropheta
Created November 12, 2017 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilpropheta/20d99673c61183df962a3d536130be70 to your computer and use it in GitHub Desktop.
Save ilpropheta/20d99673c61183df962a3d536130be70 to your computer and use it in GitHub Desktop.
vector<double> expected = ...;
vector<double> actual = ...;
double maxDifference = 0.0; // fabs cannot be smaller than 0
for (auto i=0; i<expected.size(); ++i)
{
maxDifference = max(maxDifference, fabs(expected[i]-actual[i]));
}
cout << maxDifference;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment