rint() is an inbuilt method in Java which is used to round of the floating-point argument to an integer value (in floating-point format).
The rint() function takes a mandatory single argument value to round.
A double value is returned. This method returns the integer that is closest in value to the argument.
Code#1: Program demonstrating the use of rint() function
In case of 0.5 at decimal places it will round off to nearest even double value.
Code#2: Program explaining the exceptions
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- StrictMath rint() Method in Java
- Rounding off errors in Java
- Java.util.LinkedList.poll(), pollFirst(), pollLast() with examples in Java
- Java.util.Collections.disjoint() Method in java with Examples
- Java lang.Long.lowestOneBit() method in Java with Examples
- Java.lang.Short toString() method in Java with Examples
- Java lang.Long.reverse() method in Java with Examples
- Java lang.Long.byteValue() method in Java with Examples
- Java.util.concurrent.Phaser class in Java with Examples
- Java lang.Long.numberOfLeadingZeros() method in Java with Examples
- Java.util.Collections.rotate() Method in Java with Examples
- Java lang.Long.highestOneBit() method in Java with Examples
- Java lang.Long.numberOfTrailingZeros() method in Java with Examples
- Java.util.concurrent.RecursiveTask class in Java with Examples
- Java.util.BitSet class methods in Java with Examples | Set 2
- Java Deprecated API Scanner tool (jdepscan) in Java 9 with Examples
- Java.util.LinkedList.peek() , peekfirst(), peeklast() in Java
- Java.util.LinkedList.offer(), offerFirst(), offerLast() in Java
- Java.util.function.IntPredicate interface in Java with Examples
- Java.util.function.LongPredicate interface in Java with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.