Skip to content

Instantly share code, notes, and snippets.

@HectorTorres
Created January 16, 2023 20:20
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 HectorTorres/fcd3fce416478ccb653e96a61b2a2216 to your computer and use it in GitHub Desktop.
Save HectorTorres/fcd3fce416478ccb653e96a61b2a2216 to your computer and use it in GitHub Desktop.
// whattotest.cpp
#include <math.h>
double squareRoot(const double a) {
double b = sqrt(a);
if(b != b) { // nan check
return -1.0;
}else{
return sqrt(a);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment