double numbers[ ] = { 1, 0.5 ,0.333333 ,0.25 ,0.2, 0.166667, 0.142857, 0.125, 0.111111, 0.1 } ; std::vector doublenumbers ( numb
You're calling accumulate with 0 as the init argument, so it'll accumulate using integer maths. Use 0.0 instead.
accumulate
0
init
0.0