RosettaCodeData/Task/Exceptions/Mathematica/exceptions.mathematica
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

8 lines
115 B
Mathematica

f[x_] := If[x > 10, Throw[overflow], x!]
Example usage :
Catch[f[2] + f[11]]
-> overflow
Catch[f[2] + f[3]]
-> 8