                 shiftone = Scalar(0.5);
                 }
             
-            nxi = __float2int_rd(pos_frac.x + shift);
-            nyi = __float2int_rd(pos_frac.y + shift);
-            nzi = __float2int_rd(pos_frac.z + shift);
-    
-            dx = shiftone+(float)nxi-pos_frac.x;
-            dy = shiftone+(float)nyi-pos_frac.y;
-            dz = shiftone+(float)nzi-pos_frac.z;
+            nxi = __scalar2int_rd(pos_frac.x + shift);
+            nyi = __scalar2int_rd(pos_frac.y + shift);
+            nzi = __scalar2int_rd(pos_frac.z + shift);
+    
+            dx = shiftone+(Scalar)nxi-pos_frac.x;
+            dy = shiftone+(Scalar)nyi-pos_frac.y;
+            dz = shiftone+(Scalar)nzi-pos_frac.z;
  
             int n,m,l,k;
             Scalar result;

                wx = fast::pow(gpu_sinc(argx),order);

               for (iy = -nby; iy <= nby; iy++) {
                    qy = (j.y+(float)(Ny*iy));
                    kn2 = b2 * qy;
                    argy = Scalar(0.5)*qy*kH.y;
                    wy = fast::pow(gpu_sinc(argy),order);

    if (error != cudaSuccess)
        return error;

    gpu_fix_exclusions_kernel <<< grid, threads >>>  (d_force,
                                                      d_virial,
                                                      virial_pitch,
