using an if statement to switch nan values in an array to 0.0?
===

I am doing some calculations with points and the vectors between the points and it is no surprise to me that I get nan for when the points are very close together. What I am trying to do now is rid all the nan values in the array that I have stored in an array along with the good data. I am hoping to just use a bit of code like so:

       if( angle[i] == nan ) { angle[i] = 0.0 };

at least that is what I have tried and I get errors when I try that. Does any one know how to get rid of nan values and replace them with just a 0.0?

Thanks for the help,
Luke H