Subtraction Problem

 

The following code subtracts the close of 2 bars. The resulting value (CloseDiff) is zero but the 2 close values are not the same. I verify this by PRINTing the values to the expert panel.

Can someone explain what might be happening here? I am stumped.


double CloseDiff[];


for(i=0; i <= Bars; i++)

{
CloseDiff[i]= Close[i]-Close[i+1];
Print("Close[i]=", Close[i]," Close[i+1]=", Close[i+1]," CloseDiff=", CloseDiff[i]);

}


sample print: Close[i]=1.7355 Close[i+1]=1.7347 CloseDiff[i]=0

 
SquareRoot:

The following code subtracts the close of 2 bars. The resulting value (CloseDiff) is zero but the 2 close values are not the same. I verify this by PRINTing the values to the expert panel.

Can someone explain what might be happening here? I am stumped.


double CloseDiff[];


for(i=0; i <= Bars; i++)

{
CloseDiff[i]= Close[i]-Close[i+1];
Print("Close[i]=", Close[i]," Close[i+1]=", Close[i+1]," CloseDiff=", CloseDiff[i]);

}


sample print: Close[i]=1.7355 Close[i+1]=1.7347 CloseDiff[i]=0

Problem found!!!