RosettaCodeData/Task/Exceptions/PARI-GP/exceptions-4.pari

4 lines
221 B
Plaintext

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