I’m trying to do something where I have 3 variables (x, y and z) that could equal anything between 1 and 0. I want to create an if statement where it does ((z=x OR z=y) AND z=1). So x=1, y=0, z=1 would be true, but x=0, y=0, z=1, or x=0, y=0, z=0 wouldn’t.
I tried if(z==x | z==y & z==1) but that makes conditions where y=z=0 true, but i want z=1 to be required. I also tried flipping it, so it says if(z==1 & z==x | z==y) but that isn’t working either. It has cf=pf=of=0 as a true statement, which I don’t want. How do I make the if statement prioritize the OR before the AND?
user28678612 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.