Help!! variable at 0 or not?

Back to topics list To post a new topic, please log in or register
avatar
3
clalav 2015.06.10 12:26
 

the if:

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

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

result:

lotti sbilanciati 0

what happens?



avatar
12985
WHRoeder 2015.06.10 16:04 #
 
  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

avatar
313
JD4 2015.06.24 07:25 #
 
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?
avatar
12985
WHRoeder 2015.06.24 14:22 #
 
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.
avatar
Moderator
3407
GumRai 2015.06.24 15:22 #
 
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. 

avatar
Moderator
3206
angevoyageur 2015.06.24 16:33 #
 
The topic is closed.
Back to topics list  

To add comments, please log in or register