Replace rounding using int(x+0.5) with roundToInt
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / toppush.cpp
index 46cf9f3bbd164e228ed2bf02bf4c2d4d19cd25bd..8acd507abf4ac2a528c94b2df98cf5852254d3f3 100644 (file)
@@ -52,6 +52,7 @@
 #include "gromacs/gmxpreprocess/readir.h"
 #include "gromacs/gmxpreprocess/topdirs.h"
 #include "gromacs/gmxpreprocess/toputil.h"
+#include "gromacs/math/functions.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/topology/ifunc.h"
 #include "gromacs/topology/symtab.h"
@@ -2070,7 +2071,7 @@ void push_bond(directive d, t_params bondtype[], t_params bond[],
     {
         sprintf(errbuf, "%s table number can not be perturbed %d!=%d",
                 interaction_function[ftype].longname,
-                static_cast<int>(param.c[0]+0.5), static_cast<int>(param.c[2]+0.5));
+                gmx::roundToInt(param.c[0]), gmx::roundToInt(param.c[2]));
         warning_error_and_exit(wi, errbuf, FARGS);
     }