I have a code that calls the following function
int if_nan(double a)
{
return a!=a;
}
to find if_nan()
is encountered in calculations. When I do memcheck with Valgrind, I get the following error:
==3484== Conditional jump or move depends on uninitialised value(s)
==3484== at 0x804B0A9: if_nan (sph.c:71)
==3484== by 0x8051B78: pressure_forces (pressure_force.c:21)
...
I don't understand what value to be initialized here. Please suggest a way to avoid this error. Thank You
And we don't
understand
what you want from us by posting 1/100th of your code !!!Howver, check the below part for your clarification. And please , from next time, try to put the entire code here. Its free of cost. :-)
Case 1
code
O/P
Case 2
Code
O/P
Looks familiar? :-) [No hard feelings]