fixed a half bin misalignment in gmx_vanhove -or
authorBerk Hess <hess@kth.se>
Wed, 2 Oct 2013 12:27:07 +0000 (14:27 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 16 Oct 2013 11:50:20 +0000 (13:50 +0200)
Change-Id: Ia800861912d50f5047742bcb1bb51e753920968f

src/tools/gmx_vanhove.c

index bae747831cff4b6000800680fc1e2c06b793847e..aea369f3f26a82672656aa39daa939b6af810ab1 100644 (file)
@@ -364,7 +364,7 @@ int gmx_vanhove(int argc, char *argv[])
                     for (i = 0; i < isize; i++)
                     {
                         d2  = distance2(sx[f][i], sx[ff][i]);
-                        bin = (int)(sqrt(d2)*invbin);
+                        bin = (int)(sqrt(d2)*invbin + 0.5);
                         if (bin >= nalloc)
                         {
                             nallocn = 10*(bin/10) + 11;