wierd output of fprintf for double variable
I don't do too much programming any more. However, I just got bit by something 'interesting'. I am caculating some percentages for names in an array. It works great IF what I am calculating the percentage for has some value other than 0. On the other hand, if the percentage should be zero what I get is -nan % instead of 0.0 %. I have tried this a couple of different outpout specs including 5.1F, D, and others.
I need a clue (yes that does mean I'm clueless). Does -nan stand for anything?