Replace rounding using int(x+0.5) with roundToInt
[alexxy/gromacs.git] / src / gromacs / gmxana / anadih.cpp
index bc524a5890d8955a4492e729f2a065012b60cbf5..cf7869ced0ee85cec290c293dfa34323cc697dc8 100644 (file)
@@ -961,7 +961,7 @@ void read_ang_dih(const char *trj_fn,
             }
 
             /* Update the distribution histogram */
-            angind = static_cast<int>((angle*maxangstat)/pifac + 0.5);
+            angind = gmx::roundToInt((angle*maxangstat)/pifac);
             if (angind == maxangstat)
             {
                 angind = 0;