NormalizeDouble(Bid, Digits) - page 4

 

Isn't it best to avoid a direct comparison of doubles? 

Since we Normalize so especially to use == operator

I think its best to use the negligibility check instead

example 


double a = iopen_0;
double b = iclose_1;

if  ( MathAbs(a-b) < Point() )
{
// then a == b..
}

 
Isho888:

Isn't it best to avoid a direct comparison of doubles? 

Since we Normalize so especially to use == operator

I think its best to use the negligibility check instead

example 


double a = iopen_0;
double b = iclose_1;

if  ( MathAbs(a-b) < Point() )
{
// then a == b..
}

This is a 1 year old thread from april/2018, I think it is all well explained on it, with every possible details.