If
If[cond, iftrue, iffalse]
returns iftrue
if cond
is True, and iffalse
if cond
is False.
Attributes[If] := {HoldRest, Protected}
Simple examples
Further examples
Undefined conditions leave the statement unevaluated.
If[cond, iftrue, iffalse]
returns iftrue
if cond
is True, and iffalse
if cond
is False.
Attributes[If] := {HoldRest, Protected}
Undefined conditions leave the statement unevaluated.