I'm not sure why the code below is not working, I'm trying to find the value of NaN in the array and then move NaN to the first element in the array (element 0) and swap the existing element 0 with wherever the NaN was. Please can you check my code out? Maybe you guys/girls can see something I can't?
Thanks in advance!
#define NaN (float)(1e308*10*0)
void movenan(float array[], int size)
{
int w;
float hold;
float move;
for(w = 0; w < SIZE - 1; w++)
{
if(array[w] == NaN)
{
hold = array[w];
array[w] = array[0];
array[0] = hold;
}
}
}