Official Javadoc says that Math.floor() returns a double that is ‘equal to a mathematical integer’, but then why shouldn’t it return an int?
Official Javadoc says that Math.floor() returns a double that is equal to a mathematical
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to the same Javadoc:
If the argument is
NaNor an infinity or positive zero or negative zero, then the result is the same as the argument. Can’t do that with anint.The largest
doublevalue is also larger than the largestint, so it would have to be along.