Hello,
I encounter a strange behaviour from strictly superior statement for if condition.
Under a while loop I’ve got the following code
textmsg("*********FullBin: ",FullBin)
textmsg("*********FullBin_Cnt: ",FullBin_Cnt[Cycle])
textmsg("*********(FullBin_Cnt[Cycle]>FullBin): ",(FullBin_Cnt[Cycle]>FullBin))
if (FullBin_Cnt[Cycle]>FullBin):
textmsg("########Current Best Cycle: ",Cycle)
FullBin=FullBin_Cnt[Cycle]
textmsg("########FullBin: ",FullBin)
Pdt_X=Pdt_X_Method
Pdt_Y=Pdt_Y_Method
Pdt_Z=Pdt_Z_Method
Nb_Max=NbPdtMax_Method
Solution=Sol_Method
Drop_Pdt_Nb_X=Pdt_Nb_X_Method
Drop_Pdt_Nb_Y=Pdt_Nb_Y_Method
Drop_Pdt_Nb_Z=Pdt_Nb_Z_Method
Off_X=Offset_X_Meth
Off_Y=Offset_Y_Meth
Drop_Side_Meth=Drop_Side_Method
Best_Cycle=Cycle
end
FullBin_Cnt[Cycle] is an array which contain a multiplication result for each cycle.
FullBin is initialized to 0.
If FullBin_Cnt[Cycle] is strictly superior to FullBin then FullBin take the value of FullBin_Cnt for the current cycle.
When the while loop is finished:
FullBin_Cnt=[0,26,30,16,18,30,0,0]
FullBin=30
Best_Cycle=5 instead of 2.
To understand what was wrong I choose to subtract FullBin_Cnt[Cycle(=5)] and FullBin, when both were supposed to be 30.
The result is 7.10543e - 15.
The variable are supposed to be integer, how come that the difference is not 0?