I\'m writing a project that we do simple calculator from command line. The users input in this format programname firstNumber operator secondNumber. Here what I
atoi converts the parameter into an int (hence truncating after the decimal point). You need to convert it into a double. You should instead use std::atof, or, if using C++11, may also use std::stod(argv[1]);.