This week's book giveaway is in the Security forum.
We're giving away four copies of Securing DevOps and have Julien Vehent on-line!
See this thread for details.
Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NaN  RSS feed

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Enthuware I encountered some questions about NaNs, like:

Which of the following statements about NaNs are true?

Float.NaN == Float.NaN
Float.NaN == Double.NaN
Float.NaN >= 0
Float.NaN < 0
None of the above

I can't remember reading anything about NaNs in the K & B book. Are NaNs part of the exam?

Thanks,

John
 
Saloon Keeper
Posts: 8481
155
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure, but NaN comparisons are pretty simply: everything returns false. I believe NaN doesn't even equal itself.
 
John Stark
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are right Float.NaN == Float.NaN gives false. That makes it pretty easy then, thanks.

John
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!