Download MetaTrader 5

Help!! variable at 0 or not?

To add comments, please log in or register
clalav
16
clalav  

the if:

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

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

result:

lotti sbilanciati 0

what happens?

whroeder1
14785
whroeder1  
  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
JD4
1101
JD4  
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?
whroeder1
14785
whroeder1  
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.
Keith Watford
Moderator
9641
Keith Watford  
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. 

Alain Verleyen
Moderator
31203
Alain Verleyen  
The topic is closed.
To add comments, please log in or register