I had to use a similar code on some work I had to do and got this error. Basically I can´t understand why R says that the remainder of 234/6.5 is 6.5 when inside the loop but 0 (as it should be) when outside.
x=0
for (i in 1:100){
x=x+3.6
if (i==65){
print(x)
print(x%%6.5==0)
print(x%%6.5)
}
if(x%%6.5==0){
#print(i)
break
}
}
x=234
x%%6.5==0
[1] 234
[1] FALSE
[1] 6.5
> x=234
>
> x%%6.5==0
[1] TRUE
Any help is appreciated, and sorry for bad the english/explanation