rint() is an inherent process in Java that is utilized to round the floating-point argument to a figure value (in floating-point format). Parameters: The rint() purpose takes an obligatory single argument value to round. The process rint returns the figure that is closest in charge to the argument.
double rint(double d)
Here is the detail of parameters −
public class Test { public static void main(String args[]) { double d = 100.675; double e = 100.500; double f = 100.200; System.out.println(Math.rint(d)); System.out.println(Math.rint(e)); System.out.println(Math.rint(f)); } }
This will produce the following result:
101.0 100.0 100.0
Here at Intellinuts, we have created a complete Java tutorial for Beginners to get started in Java.