Replace rounding using int(x+0.5) with roundToInt
[alexxy/gromacs.git] / src / gromacs / domdec / distribute.cpp
index 040d75626e13307082bd72d46153ff939263a3fe..1b4520f425aae261474fea0e7b8420d3c6d888b3 100644 (file)
@@ -422,7 +422,7 @@ getAtomGroupDistribution(FILE *fplog,
         fprintf(fplog, "Atom distribution over %d domains: av %d stddev %d min %d max %d\n",
                 dd->nnodes,
                 nat_sum,
-                static_cast<int>(std::sqrt(nat2_sum - gmx::square(static_cast<double>(nat_sum)) + 0.5)),
+                gmx::roundToInt(std::sqrt(nat2_sum - gmx::square(static_cast<double>(nat_sum)))),
                 nat_min, nat_max);
     }