GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
#include "typedef.h"1#include "tools.h"23/**************************************************************************\4@---------------------------------------------------------------------------5@---------------------------------------------------------------------------6@ FILE: ovfl_mul.c7@---------------------------------------------------------------------------8@---------------------------------------------------------------------------9@10\**************************************************************************/1112/*13@-------------------------------------------------------------------------14@ int ovfl_mul( a, b);15@ int a,b;16@17@ The routine should catch an integer-overflow.18@ Slow. Unluckily "c" does not provide machine-independent access to the19@ integer hardware overflow-routines.20@ if there is no overflow the function returns the product a*b,21@ otherwise the program exits.22@23@-------------------------------------------------------------------------24*/25int ovfl_mul( a, b)26int a, b;27{28register int result;2930result = a * b;31if ( result / a != b ) {32fprintf(stderr,"ovfl_mul: Error: Integer overflow during multiplication\n");33fprintf(stderr,"left operand: 0x%08x, right operand: 0x%08x, result: 0x%08x\n", a, b, result );34exit(3);35}36return result;37}3839/*{{{}}}*/404142