Почему функция std :: аккумулирует неверную сумму вектора <double>?

Рассмотрим следующий код для добавления всех элементов:vector

#include
#include
#include
#include
using namespace std;
int main(void)
{

   std::vector V;
   V.push_back(1.2);
   V.push_back(3.6);
   V.push_back(5.6);
   double sum = accumulate(V.begin(),V.end(),0);

   cout < "The sum of the elements of the vector V is " < sum < endl;
   return 0;
}

Ответы на вопрос(4)

Ваш ответ на вопрос