1 /*
2 Copyright (C) 2015 Fredrik Johansson
3 Copyright (C) 2015 Arb authors
4
5 This file is part of Arb.
6
7 Arb is free software: you can redistribute it and/or modify it under
8 the terms of the GNU Lesser General Public License (LGPL) as published
9 by the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version. See <http://www.gnu.org/licenses/>.
11 */
12
13 #include "arb.h"
14
15 void
arb_fprint(FILE * file,const arb_t x)16 arb_fprint(FILE * file, const arb_t x)
17 {
18 arf_fprint(file, arb_midref(x));
19 flint_fprintf(file, " +/- ");
20 mag_fprint(file, arb_radref(x));
21 }
22
23 void
arb_fprintd(FILE * file,const arb_t x,slong digits)24 arb_fprintd(FILE * file, const arb_t x, slong digits)
25 {
26 arf_fprintd(file, arb_midref(x), FLINT_MAX(digits, 1));
27 flint_fprintf(file, " +/- ");
28 mag_fprintd(file, arb_radref(x), 5);
29 }
30
31 void
arb_fprintn(FILE * file,const arb_t x,slong digits,ulong flags)32 arb_fprintn(FILE * file, const arb_t x, slong digits, ulong flags)
33 {
34 char * s = arb_get_str(x, digits, flags);
35 flint_fprintf(file, "%s", s);
36 flint_free(s);
37 }
38
39