Replace rounding using int(x+0.5) with roundToInt
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_dipoles.cpp
index 302818b18ee0db7d26e34bc81e09114497ec77bc..5fe85b58a243989c9fe8c4818ff249beb3d91ab5 100644 (file)
@@ -1120,7 +1120,7 @@ static void do_dip(const t_topology *top, int ePBC, real volume,
                     mu_ave += mu_mol;                         /* calc. the average mu */
 
                     /* Update the dipole distribution */
-                    ibin = static_cast<int>(ndipbin*mu_mol/mu_max + 0.5);
+                    ibin = gmx::roundToInt(ndipbin*mu_mol/mu_max);
                     if (ibin < ndipbin)
                     {
                         dipole_bin[ibin]++;