1 // A simple program that computes the square root of a number
6 #include "TutorialConfig.h"
8 // TODO 11: Only include MathFunctions if USE_MYMATH is defined
10 // TODO 5: Include MathFunctions.h
12 int main(int argc, char* argv[])
16 std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
17 << Tutorial_VERSION_MINOR << std::endl;
18 std::cout << "Usage: " << argv[0] << " number" << std::endl;
22 // convert input to double
23 const double inputValue = std::stod(argv[1]);
25 // TODO 12: Use mysqrt if USE_MYMATH is defined and sqrt otherwise
27 // TODO 6: Replace sqrt with mysqrt
29 // calculate square root
30 const double outputValue = sqrt(inputValue);
31 std::cout << "The square root of " << inputValue << " is " << outputValue