Advertisements
Advertisements
Question
Distinguish between Math.rint( ) and Math.round( ).
Distinguish Between
Solution
S. No. | Math.rint() | Math.round() |
1. | Math.rint() returns a shortened version of a number. | Math.round() returns the rounded result, up to the closest integer. |
2. | The return type of Math.rint() is double. | Math.round() returns either int or long. |
shaalaa.com
Is there an error in this question or solution?