use MathMax().
exampil:
double v1,v2,v3;
v1=v2/MathMax(v3,0.0001);
this help previntion divied by v3=0
or, use if/then:
if(v3==0) v1=0;
etc ...
exampil:
double v1,v2,v3;
v1=v2/MathMax(v3,0.0001);
this help previntion divied by v3=0
or, use if/then:
if(v3==0) v1=0;
etc ...
Well, this too..
x/100 = x*0,01
But these solutions are anoying...
If I divide a number by 0, gives error, ok.
But if I divide 0 by a number should give 0.
Thanks
x/100 = x*0,01
But these solutions are anoying...
If I divide a number by 0, gives error, ok.
But if I divide 0 by a number should give 0.
Thanks
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
In excel that expression results 0, but in metaeditor gives error zero divide, and stops the execution.
How to make zero divide = 0?
Thanks