If Operator (Solver Foundation)

Returns the second or third argument, depending on whether the condition is true.

If[cond, arg1, arg2]

Example

If[x > 0, y, z]

This operator returns the second argument if the cond condition is true; otherwise, it returns the third argument.

The second and third arguments must be compatible.

See Also

Concepts

Optimization Modeling Language (OML)