I have a piece of code where I multiply two numbers but condition is none of those integer numbers should be 0. If it is 0, I need to make it to 1 so that it is not counted.
y=x*z // x>0, z>0. if x==0 then x=1, if z==0, then z=1;
I want to avoid "if" condition check on every variable and replace with 1. Is there a better way of doing it.
Aucun commentaire:
Enregistrer un commentaire