+ 5
What is the difference between Math.round() and Math.rint() ?
3 Answers
+ 3
Also note that when it comes to 0.5, or anything in the middle:
rInt() will return the closest even number.
round() will return the larger number.
+ 3
Here's a visual to assist
https://code.sololearn.com/cdOlvN4u05Ut/?ref=app
0
Math.round() Returns an Integer value rounded to closest integer.
Math.rint() Returns a Double value rounded to the closest whole number



