GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/* operator<< -- mpf formatted output to an ostream.12Copyright 2001, 2002 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 the GNU Lesser General Public License as published by8the Free Software Foundation; either version 2.1 of the License, or (at your9option) any later version.1011The GNU MP Library is distributed in the hope that it will be useful, but12WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY13or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public14License for more details.1516You should have received a copy of the GNU Lesser General Public License17along with the GNU MP Library; see the file COPYING.LIB. If not, write to18the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,19MA 02110-1301, USA. */2021#include <clocale>22#include <iostream>23#include <stdarg.h> /* for va_list and hence doprnt_funs_t */24#include <string.h>2526#include "gmp.h"27#include "gmp-impl.h"2829using namespace std;303132/* The gmp_asprintf support routines never give an error, so33__gmp_doprnt_mpf shouldn't fail and it's return can just be checked with34an ASSERT. */3536ostream&37operator<< (ostream &o, mpf_srcptr f)38{39struct doprnt_params_t param;40struct gmp_asprintf_t d;41char *result;42int ret;4344__gmp_doprnt_params_from_ios (¶m, o);4546#if HAVE_STD__LOCALE47char point[2];48point[0] = use_facet< numpunct<char> >(o.getloc()).decimal_point();49point[1] = '\0';50#else51const char *point = localeconv()->decimal_point;52#endif5354GMP_ASPRINTF_T_INIT (d, &result);55ret = __gmp_doprnt_mpf (&__gmp_asprintf_funs_noformat, &d, ¶m, point, f);56ASSERT (ret != -1);57__gmp_asprintf_final (&d);5859gmp_allocated_string t (result);60return o.write (t.str, t.len);61}626364