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