1 // A simple program that computes the square root of a number
5 #include "MathFunctions.h"
6 #include "TutorialConfig.h"
8 int main(int argc, char* argv[])
12 std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
13 << Tutorial_VERSION_MINOR << std::endl;
14 std::cout << "Usage: " << argv[0] << " number" << std::endl;
18 // convert input to double
19 const double inputValue = std::stod(argv[1]);
21 const double outputValue = mathfunctions::sqrt(inputValue);
23 std::cout << "The square root of " << inputValue << " is " << outputValue