a. Double confirm with you that it's not necessary to use '2' below but ok to use '1' below to compare for "int" types. Correct?
(a > b)
2. if (a - b > Point / 2.)
b. How many digits does the number precision reach while need to use '2' for comparing?
OP was talking about the operator ">", not "==".
Same thing. If because of floating point round off what should be equal could be come greater.
IF you want to open when price exceeds the last bar high, Bid > High could be true when Bid == High because of round off. If that is unacceptable equality is important.
If the possibility of equality is important, you must understand the links posted.
IF point is 0.00001 then 0.999995000000 is the same price as 1.000004999999 but they are not equal.
The OP was asking about comparing integers
Thank you. But who can help clarify on this question:
b. How many digits does the number precision reach while need to use formula '2' for comparing?
To add comments, please log in or register