PDA

View Full Version : How to handle nan in following code



eng786
June 14th, 2013, 11:33 AM
The following code is generating -nan values.
Kindly help how to resolve.

int tmp1=rand()%n;
int tmp2=rand()%nd;
temp=array[tmp1][tmp2];
printf("temp=%f\n",temp);

Regards.