0
GGGiovanny Gongora
Take each vector float and round it
0 Comments
#include <iostream> #include <vector> #include <cmath> std::vector<double> myvec = {2.3, 5.5, 7.8, -2.3, -5.5, -7.8}; for(double d : myvec){ std::cout << d << "->" << round(d) << std::endl; }