Help!! variable at 0 or not?

 

the if:

   if (cnt == total -1 && lotti_tot != 0 && total > 1)

      {Print("lotti sbilanciati ", lotti_tot);}

result:

lotti sbilanciati 0

what happens?

 
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. lotti_to was in the range [0.0000000000000001 - 0.00004999999999] (not exactly zero) but Print defaults to 4 digits. See The == operand. - MQL4 forum
 
WHRoeder:

  1. Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. lotti_to was in the range [0.0000000000000001 - 0.00004999999999] (not exactly zero) but Print defaults to 4 digits. See The == operand. - MQL4 forum

Really?  You're going to be that anal about a couple lines of code?
 
JD4: Really?  You're going to be that anal about a couple lines of code?
  1. The question was:

    variable at 0 or not?

    if variable != 0 Print(variable) and got 0 printed.
    I answered the OP's why.
  2. You're now in the category of troll: insulting and not helpful, Arrogant, Unhelpful, missed the point, argumentative, again and not helpful, after issue resolved, if(v=0){...} else {...} is unhelpful, style differences vs the topic - argumentative and are now being ignored.
 
WHRoeder:
  1. lotti_to was in the range [0.0000000000000001 - 0.00004999999999] (not exactly zero) but Print defaults to 4 digits. See The == operand. - MQL4 forum

JD4:
Really?  You're going to be that anal about a couple lines of code?

Judging from the amount of times that similar queries are posted here, I would imagine that comparing doubles is probably the most difficult thing for new coders to understand.

WHRoeder has answered the same question hundreds of times already, but instead of thinking "Oh no, not again! How many more times can this same question be posted?", he offers a brief explanation and supplies a link for people to read and learn.

That is being helpful, not anal. 

If you think that 0.0000000000000001==0, then you are going to have problems with coding mq4

WHRoeder helps a lot of people with his posts, unlike the flurry of recent posts from you that don't add anything to the thread and don't help anybody. 

 
The topic is closed.
Reason: