class Math

Difference Math.rint() Math.round()

Difference Math.rint() Math.round() First find the preliminary difference of rint() and round() methods 1. System.out.println(Math.rint(2.50)); // prints 2.0 2. System.out.println(Math.round(2.50)); // prints 3 Let us study more: 1. With rint() a) 2.50 lies between 2.00 and 3.00. rint() returns the closest even double value. The rint(2.50) returns 2.0 b) 1.50 lies between 1.00 and 2.00. …

Difference Math.rint() Math.round() Read More »