1.

Differentiate between math .ceil ( ) and math. round ()​

Answer»

Math.ceil() and Math.round() methods differ in a WAY that the former round off a number to its NEAREST integer in upward direction of rounding(TOWARDS the greater value) WHEREAS the latter round off a number to its nearest integer in downward direction of rounding(towards lower value).Math.ceil(2.6)=3Math.round(2.6)=3Math.ceil(2.4)=3Math.round(2.4)=2



Discussion

No Comment Found