GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/* operator<< -- mpz formatted output to an ostream.12Copyright 2001 Free Software Foundation, Inc.34This file is part of the GNU MP Library.56The GNU MP Library is free software; you can redistribute it and/or modify7it under the terms of either:89* the GNU Lesser General Public License as published by the Free10Software Foundation; either version 3 of the License, or (at your11option) any later version.1213or1415* the GNU General Public License as published by the Free Software16Foundation; either version 2 of the License, or (at your option) any17later version.1819or both in parallel, as here.2021The GNU MP Library is distributed in the hope that it will be useful, but22WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY23or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License24for more details.2526You should have received copies of the GNU General Public License and the27GNU Lesser General Public License along with the GNU MP Library. If not,28see https://www.gnu.org/licenses/. */2930#include <iostream>31#include <stdarg.h> /* for va_list and hence doprnt_funs_t */32#include <string.h>3334#include "gmp.h"35#include "gmp-impl.h"3637using namespace std;383940ostream&41operator<< (ostream &o, mpz_srcptr z)42{43struct doprnt_params_t param;44__gmp_doprnt_params_from_ios (¶m, o);45return __gmp_doprnt_integer_ostream (o, ¶m,46mpz_get_str (NULL, param.base, z));47}484950