0
What does means (-nan) in C programming languange? And why this happens?
Im using a loop to calculate the distance between particles, in the first loop, everything is fine, but in the second step, the programming os returning (-nan). https://code.sololearn.com/cwytl4cfpzpg/?ref=app https://code.sololearn.com/cwytl4cfpzpg/?ref=app
5 Réponses
+ 1
Your variables loops and natom haven’t been declared. They need to be set to some value before running.
+ 1
The nan means not a number so that must mean your natom variable isn’t a number. You will have to check the code where it is generated.
0
But they are
0
I dont writed the all code, but in the top they are
0
In bottom of the code natom is
# define natom = 100