Comparsion Problem

 
Hello,
i try to compare two double number with the same value but the querie is false

double a,b;
 
a=High[i]-Open[i]; //The Result is 0.0001
b=1.3333-1.3332; //The Result is 0.0001
 
 
if(a==b)Print("true"); //Result is false
if(a>b)Print("true"); //Result is true
if(a<b)Print("true"); //Result is false

What ist the problem please, why does this dont match?
 

change them to such : (a-b) > 0 or (b-a) < 0

since teh expression of most double digitals by computer are not precise !!!

 
Try this
if( NormalizeDouble(a,4) == NormalizeDouble(b,4) )
    Print( "true" );
else
    Print( "false" );
 
Hello fireflies, you are right with your solution, thank you very much, god bless you all :-).