#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;
      }
      

      Cpp language logoRound vector values

      Codiga's C++ Recipes

      Take each vector float and round it

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.