RosettaCodeData/Task/Exceptions/PARI-GP/exceptions-4.pari
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

3 lines
221 B
Text

GEN x = closure_trapgen(arither1, f); // Executes the function f, catching "not an integer argument in an arithmetic function" errors
if (x == (GEN)1L) // Was there an error?
pari_printf("Don't do that!\n"); // Recover