This question says it all. I have an array of doubles and am doing something with them.
double expectedOutput[] = { 6.38792, 12.91079, 14.33333, 13.44517, 12.34539, 12.05397, 8.34061, 2.07900, -2.01999, -5.47802, -8.21610, -9.26719, -11.02378 };
Ideally, I would check if
6.38792 == 6.38792 and you end up with 'pass'
Under certain conditions, I get a situation like
6.38792 != NaN
Knowing that this is a random case sometimes, how can I represent NaN in my code?
Do I need to include NaNs in my array of expected elements or somehow figure out that the result is not A Number
I am using java
source share