Assertions: Difference between revisions

→‎{{header|PARI/GP}}: more traditional PARI
(→‎{{header|PARI/GP}}: more traditional PARI)
Line 644:
{{trans|C}}
<lang C>#include <assert.h>
#include <pari/pari.h>
 
void
test()
{
intGEN a;
// ... input or change a here
 
assert(equalis(a ==, 42)); //* Aborts program if a is not 42, unless the NDEBUG macro was defined */
}</lang>
 
More common is the use of <code>pari_err_BUG</code> in such cases:
<lang C>if (!equalis(a, 42)) pari_err_BUG("this_function_name (expected a = 42)");</lang>
 
=={{header|Pascal}}==