Differentiate between both a and b
Attachments:
Answers
Answered by
2
The method Math.floor() returns the largest Double data type that is less than or equal to the argument and is equal to mathematical integer. It is basically floor function that we study in mathematics.
Example:
if x=8.6
Math.floor(x)=8
The method Math.ceil returns the smallest Double data type that is greater than or equal to the argument and is equal to mathematical integer. It is ceil function that we also study in mathematics.
Example:
if x=8.6
Math.floor(x)=9
Math.rint() returns the closest even(2,4,6..2n) double value. Math.rint(2.50) returns 2.0.
Math.round() returns the closest higher whole number. Math.round(2.50) returns 3
Similar questions