Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346/* 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 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 <clocale>31#include <iostream>32#include <stdarg.h> /* for va_list and hence doprnt_funs_t */33#include <string.h>3435#include "gmp.h"36#include "gmp-impl.h"3738using namespace std;394041/* The gmp_asprintf support routines never give an error, so42__gmp_doprnt_mpf shouldn't fail and it's return can just be checked with43an ASSERT. */4445ostream&46operator<< (ostream &o, mpf_srcptr f)47{48struct doprnt_params_t param;49struct gmp_asprintf_t d;50char *result;51int ret;5253__gmp_doprnt_params_from_ios (¶m, o);5455#if HAVE_STD__LOCALE56char point[2];57point[0] = use_facet< numpunct<char> >(o.getloc()).decimal_point();58point[1] = '\0';59#else60const char *point = GMP_DECIMAL_POINT;61#endif6263GMP_ASPRINTF_T_INIT (d, &result);64ret = __gmp_doprnt_mpf (&__gmp_asprintf_funs_noformat, &d, ¶m, point, f);65ASSERT (ret != -1);66__gmp_asprintf_final (&d);6768gmp_allocated_string t (result);69return o.write (t.str, t.len);70}717273