Skip to content
Snippets Groups Projects
Commit f1334f09 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

Proper rounding when doing integer compression for floats

parent bd3b4595
Branches
Tags
No related merge requests found
...@@ -36,7 +36,7 @@ namespace{ ...@@ -36,7 +36,7 @@ namespace{
std::vector<int>& int_vec, Real factor) { std::vector<int>& int_vec, Real factor) {
int_vec.resize(real_vec.size()); int_vec.resize(real_vec.size());
for(uint i = 0; i < real_vec.size(); ++i) { for(uint i = 0; i < real_vec.size(); ++i) {
int_vec[i] = factor*real_vec[i]; int_vec[i] = std::round(factor*real_vec[i]);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment