And how do you like this non-standard option?
x>y && z=xy; x>y || z=y-x+1;
Of course, there is no ternary operation here, but it has already been brought. As a last resort, if necessary, can be done 1? 2: 3; as wrote @zhioev .
After the first comment there were more ideas:
First, it is possible without brackets:
x>y && z=xy || z=y-x+1
If you can rewrite it like this:
x<=y && z=y-x+1 || z=xy
Only these examples will work correctly, because if x> y, then z will never be equal to 0, and there will be no problems with the fact that the second condition starts to be fulfilled, if the first is true. In other cases, you can easily make a mistake.