It is ok to do this?
double doubleVariable=0.0; if (doubleVariable==0) { ... }
Or this code would suffer from potential rounding problem
You should not use double for such comparision. double creates problem. e.g double n1=0.55 double n2=100 then double ans=n1*n2 should be 55.0 but when you debug ans is 55.000000000000007. if(ans==55.0) will fail. in such case you can face a problem.
double n1=0.55
double n2=100
double ans=n1*n2
55.0
55.000000000000007
if(ans==55.0)