Math.rint(4.5) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Math.rint(4.5)

Java

14th Apr 2020, 5:00 PM
Chetan Singh
Chetan Singh - avatar
3 Answers
+ 1
4.0
14th Apr 2020, 5:00 PM
Chetan Singh
Chetan Singh - avatar
+ 5
Math rint returns a value that is closest in value to the argument provided and is an integer! It returns double values (a data type for decimal values). You can say it rounds off the number.
14th Apr 2020, 8:28 PM
SHADOW 🌀
SHADOW 🌀 - avatar
+ 1
Hi Chetan Singh the Math.rint() is similar to a Math.round() but returns a floating point value. For cases where you have 0.5 in the decimal place then it will round to the nearest even value.
14th Apr 2020, 6:12 PM
Avinesh
Avinesh - avatar