GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/* gmp_errno, __gmp_exception -- exception handling and reporting.12THE FUNCTIONS IN THIS FILE, APART FROM gmp_errno, ARE FOR INTERNAL USE3ONLY. THEY'RE ALMOST CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR4DISAPPEAR COMPLETELY IN FUTURE GNU MP RELEASES.56Copyright 2000, 2001, 2003 Free Software Foundation, Inc.78This file is part of the GNU MP Library.910The GNU MP Library is free software; you can redistribute it and/or modify11it under the terms of the GNU Lesser General Public License as published by12the Free Software Foundation; either version 2.1 of the License, or (at your13option) any later version.1415The GNU MP Library is distributed in the hope that it will be useful, but16WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY17or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public18License for more details.1920You should have received a copy of the GNU Lesser General Public License21along with the GNU MP Library; see the file COPYING.LIB. If not, write to22the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,23MA 02110-1301, USA. */2425#include <stdlib.h>26#include "gmp.h"27#include "gmp-impl.h"2829int gmp_errno = 0;303132/* The deliberate divide by zero triggers an exception on most systems. On33those where it doesn't, for example power and powerpc, use abort instead.3435Enhancement: Perhaps raise(SIGFPE) (or the same with kill()) would be36better than abort. Perhaps it'd be possible to get the BSD style37FPE_INTDIV_TRAP parameter in there too. */3839void40__gmp_exception (int error_bit)41{42gmp_errno |= error_bit;43__gmp_junk = 10 / __gmp_0;44abort ();45}464748/* These functions minimize the amount of code required in functions raising49exceptions. Since they're "noreturn" and don't take any parameters, a50test and call might even come out as a simple conditional jump. */51void52__gmp_sqrt_of_negative (void)53{54__gmp_exception (GMP_ERROR_SQRT_OF_NEGATIVE);55}56void57__gmp_divide_by_zero (void)58{59__gmp_exception (GMP_ERROR_DIVISION_BY_ZERO);60}616263