and how would double be causing problem?
I donât know itâs a double is problem or not. I say only, that I donât use doble in my code. {in my opinion] the bug[s] lay in this lines:
if(((f[1]-f[2])*1.0)/2!=f[0]*1.0||f[0]==0) double c2=ceil(((f[1]-f[2])*1.0)/4);
My program is giving 10 too.
No, it isnâs double problem.
Think what if: f[0] != 0 and ((f[1] - f[2])*1.0)/2 == f[0]*1.0
f[0] != 0 and ((f[1] - f[2])*1.0)/2 == f[0]*1.0
PS Maybe better: int f[4] = {0}; /* f[2] for 1/2 = 2/4 f[1] for 1/4 f[3] for 3/4 f[0] for nothing */ or f1, f2, f3 or f1_4, f1_2, f3_4
well finally did it âŠdouble was not the problem I just overlooked one case