How to check for Double.NaN in JSP with JSTL tags?
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.
One thing to look out for when working with Double.NaN is that Double.NaN (I think it is even in the IEEE spec) is supposed to compare as not equal to everything including NaN.
Hence, the only way to properly check if a number is NaN (apart from creating a String out of it) is to see if the value != value. JSTL is not my cup of tea but I guess it is valid there as well.
Read more in Wikipedia