Created
January 16, 2023 20:20
-
-
Save HectorTorres/fcd3fce416478ccb653e96a61b2a2216 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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