for (double d = 0.1; d<=1.0; d+=0.01) System.out.println(d + "-> " + round(d));
/* Return the closest long to the argument. * ERROR CHECKING OMITTED. */ long di = (long)Math.floor(d); // integral value below (or ==) d if ((d - di) > THRESHOLD) return di + 1; else return di;