// Java normally truncates (rounds toward 0 in IEEE jargon) double x1 = 5673892.61; long trunc = (long)x1; // prints 5673892 out.println( trunc ); // Sometimes Java appears to round, but that is an illusion // created because doubles are only accurate to 14 or 15 figures. double x2 = 5673892111111112.61; long round = (long)x2; // prints 5673892111111113 out.println( round );