RosettaCodeData/Task/Exceptions/Mathematica/exceptions.math

9 lines
115 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
f[x_] := If[x > 10, Throw[overflow], x!]
Example usage :
Catch[f[2] + f[11]]
-> overflow
Catch[f[2] + f[3]]
-> 8