I just got a question that I can’t answer.
Suppose you have this loop definition in Java:
while (i == i) ;
What is the type of i and the value of i if the loop is not an infinite loop and the program is using only one thread?
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.
The API for Double.equals() spells out the answer: ‘Double.NaN==Double.NaN has the value false’. This is elaborated in the Java Language Specification under ‘Floating-Point Types, Formats, and Values‘: