for (unsigned int j=0;j<res.size();j++) {
cout << res[j] << "\t";
}
cout << "\n\n" ;
For some integers which were put in vector res I got a "wrong" answer, for example:
9 will be 8.999999488
43 will be 43.00000256
45 will be 44.99999744
If I take out the statement
cout.precision(10);
then all the integers will stay integers,that is 9 will be 9 etc.
This is actually embedded in a large program. If I just write another small program to repeat this phenomenon, it gives always the correct answer, that is 9 to 9, 43 to 43.