How to make zero divide = 0
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
In excel that expression results 0, but in metaeditor gives error zero divide, and stops the execution.
How to make zero divide = 0?
Thanks