why is Math.floor(Double.MIN_VALUE) == 0 ?
can any one send me the java algorithme of Floor function or at least explain this result please?
why is Math.floor(Double.MIN_VALUE) == 0 ? can any one send me the java algorithme
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.
Double.MIN_VALUEdoesn’t mean what you think it means. It means “the smallest positivedoublevalue” – so naturally when you take the “floor” of it (largest integer less than or equal to the value), you’ll get 0. Documentation:I agree that the name is confusing, but it’s always worth checking the documentation as soon as you see confusing behaviour.
If you want to get the “lowest” finite
double, just use-double.MAX_VALUE.