Replace rounding using int(x+0.5) with roundToInt
[alexxy/gromacs.git] / src / programs / mdrun / mdrun.cpp
index ae214d59a57995393b4040c9439f9ea2069e2e05..651b97a4c2614638b6f8686679c2da2001e3cafa 100644 (file)
@@ -499,9 +499,9 @@ int Mdrunner::mainFunction(int argc, char *argv[])
 
     domdecOptions.rankOrder    = static_cast<DdRankOrder>(nenum(ddrank_opt_choices));
     domdecOptions.dlbOption    = static_cast<DlbOption>(nenum(dddlb_opt_choices));
-    domdecOptions.numCells[XX] = static_cast<int>(realddxyz[XX] + 0.5);
-    domdecOptions.numCells[YY] = static_cast<int>(realddxyz[YY] + 0.5);
-    domdecOptions.numCells[ZZ] = static_cast<int>(realddxyz[ZZ] + 0.5);
+    domdecOptions.numCells[XX] = roundToInt(realddxyz[XX]);
+    domdecOptions.numCells[YY] = roundToInt(realddxyz[YY]);
+    domdecOptions.numCells[ZZ] = roundToInt(realddxyz[ZZ]);
 
     nbpu_opt    = nbpu_opt_choices[0];
     pme_opt     = pme_opt_choices[0];