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/* __gmp_doprnt_integer_ios -- integer formatted output to an ostream.12THE FUNCTIONS IN THIS FILE ARE FOR INTERNAL USE ONLY. THEY'RE ALMOST3CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN4FUTURE GNU MP RELEASES.56Copyright 2001 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 either:1213* the GNU Lesser General Public License as published by the Free14Software Foundation; either version 3 of the License, or (at your15option) any later version.1617or1819* the GNU General Public License as published by the Free Software20Foundation; either version 2 of the License, or (at your option) any21later version.2223or both in parallel, as here.2425The GNU MP Library is distributed in the hope that it will be useful, but26WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY27or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License28for more details.2930You should have received copies of the GNU General Public License and the31GNU Lesser General Public License along with the GNU MP Library. If not,32see https://www.gnu.org/licenses/. */3334#include <iostream>35#include <stdarg.h> /* for va_list and hence doprnt_funs_t */36#include <string.h> /* for strlen */3738#include "gmp.h"39#include "gmp-impl.h"4041using namespace std;424344/* The gmp_asprintf support routines never give an error, so45__gmp_doprnt_integer shouldn't fail and it's return can just be checked46with an ASSERT. */4748ostream&49__gmp_doprnt_integer_ostream (ostream &o, struct doprnt_params_t *p,50char *s)51{52struct gmp_asprintf_t d;53char *result;54int ret;5556/* don't show leading zeros the way printf does */57p->prec = -1;5859GMP_ASPRINTF_T_INIT (d, &result);60ret = __gmp_doprnt_integer (&__gmp_asprintf_funs_noformat, &d, p, s);61ASSERT (ret != -1);62__gmp_asprintf_final (&d);63(*__gmp_free_func) (s, strlen(s)+1);6465gmp_allocated_string t (result);66return o.write (t.str, t.len);67}686970