Replace rounding using int(x+0.5) with roundToInt
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_tcaf.cpp
index 6cb1ed63fc178fbcea7a1839f97a33104cd83945..7e1553e18e45cf397bbced9dc9c4e99b2897d937 100644 (file)
@@ -107,9 +107,9 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
     }
 
     ncorr = (nframes+1)/2;
-    if (ncorr > static_cast<int>(5*wt/dt+0.5))
+    if (ncorr > gmx::roundToInt(5*wt/dt))
     {
-        ncorr = static_cast<int>(5*wt/dt+0.5)+1;
+        ncorr = gmx::roundToInt(5*wt/dt)+1;
     }
     snew(tcaf, nk);
     for (k = 0; k < nk; k++)