RosettaCodeData/Task/Exceptions/Mathematica/exceptions.math
2023-07-01 13:44:08 -04:00

8 lines
115 B
Text

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