1from fpylll.gmp.types cimport *
2
3cdef extern from "mpfr.h":
4    ctypedef struct __mpfr_struct:
5        pass
6
7    ctypedef __mpfr_struct mpfr_t[1]
8    ctypedef __mpfr_struct* mpfr_ptr
9    ctypedef __mpfr_struct* mpfr_srcptr
10    ctypedef enum mpfr_rnd_t:
11        MPFR_RNDN
12        MPFR_RNDZ
13        MPFR_RNDU
14        MPFR_RNDD
15        MPFR_RNDA
16        MPFR_RNDF
17        MPFR_RNDNA
18        GMP_RNDN
19        GMP_RNDZ
20        GMP_RNDU
21        GMP_RNDD
22
23    ctypedef mpfr_rnd_t mp_rnd_t
24    ctypedef long mp_prec_t
25
26    int MPFR_PREC_MIN, MPFR_PREC_MAX
27
28    # Initialization Functions
29    void mpfr_init2 (mpfr_t x, mp_prec_t prec)
30    void mpfr_clear (mpfr_t x)
31    void mpfr_init (mpfr_t x)
32    void mpfr_set_default_prec (mp_prec_t prec)
33    mp_prec_t mpfr_get_default_prec ()
34    void mpfr_set_prec (mpfr_t x, mp_prec_t prec)
35    mp_prec_t mpfr_get_prec (mpfr_t x)
36
37    # Assignment Functions
38    int mpfr_set (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
39    int mpfr_set_ui (mpfr_t rop, unsigned long int op, mp_rnd_t rnd)
40    int mpfr_set_si (mpfr_t rop, long int op, mp_rnd_t rnd)
41    int mpfr_set_d (mpfr_t rop, double op, mp_rnd_t rnd)
42    int mpfr_set_ld (mpfr_t rop, long double op, mp_rnd_t rnd)
43    # int mpfr_set_decimal64 (mpfr_t rop, _Decimal64 op, mp_rnd_t rnd)
44    int mpfr_set_z (mpfr_t rop, mpz_t op, mp_rnd_t rnd)
45    int mpfr_set_q (mpfr_t rop, mpq_t op, mp_rnd_t rnd)
46    # int mpfr_set_f (mpfr_t rop, mpf_t op, mp_rnd_t rnd)
47    int mpfr_set_ui_2exp (mpfr_t rop, unsigned long int op, mp_exp_t e, mp_rnd_t rnd)
48    int mpfr_set_si_2exp (mpfr_t rop, long int op, mp_exp_t e, mp_rnd_t rnd)
49    int mpfr_set_str (mpfr_t rop,  char *s, int base, mp_rnd_t rnd)
50    int mpfr_strtofr (mpfr_t rop, char *nptr, char **endptr, int base, mp_rnd_t rnd)
51    void mpfr_set_inf (mpfr_t x, int sign)
52    void mpfr_set_nan (mpfr_t x)
53    void mpfr_set_zero (mpfr_t x, int sign)
54    void mpfr_swap (mpfr_t x, mpfr_t y)
55
56    # Combined Initialization and Assignment Functions
57    int mpfr_init_set (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
58    int mpfr_init_set_ui (mpfr_t rop, unsigned long int op, mp_rnd_t rnd)
59    int mpfr_init_set_si (mpfr_t rop, signed long int op, mp_rnd_t rnd)
60    int mpfr_init_set_d (mpfr_t rop, double op, mp_rnd_t rnd)
61    int mpfr_init_set_ld (mpfr_t rop, long double op, mp_rnd_t rnd)
62    int mpfr_init_set_z (mpfr_t rop, mpz_t op, mp_rnd_t rnd)
63    int mpfr_init_set_q (mpfr_t rop, mpq_t op, mp_rnd_t rnd)
64    # int mpfr_init_set_f (mpfr_t rop, mpf_t op, mp_rnd_t rnd)
65    int mpfr_init_set_str (mpfr_t x, char *s, int base, mp_rnd_t rnd)
66
67    # Conversion Functions
68    double mpfr_get_d (mpfr_t op, mp_rnd_t rnd)
69    long double mpfr_get_ld (mpfr_t op, mp_rnd_t rnd)
70    # _Decimal64 mpfr_get_decimal64 (mpfr_t op, mp_rnd_t rnd)
71    double mpfr_get_d_2exp (long *exp, mpfr_t op, mp_rnd_t rnd)
72    long double mpfr_get_ld_2exp (long *exp, mpfr_t op, mp_rnd_t rnd)
73    long mpfr_get_si (mpfr_t op, mp_rnd_t rnd)
74    unsigned long mpfr_get_ui (mpfr_t op, mp_rnd_t rnd)
75    mp_exp_t mpfr_get_z_exp (mpz_t rop, mpfr_t op)
76    void mpfr_get_z (mpz_t rop, mpfr_t op, mp_rnd_t rnd)
77    # int mpfr_get_f (mpf_t rop, mpfr_t op, mp_rnd_t rnd)
78    char * mpfr_get_str (char *str, mp_exp_t *expptr, int b, size_t n, mpfr_t op, mp_rnd_t rnd)
79    void mpfr_free_str (char *str)
80    bint mpfr_fits_ulong_p (mpfr_t op, mp_rnd_t rnd)
81    bint mpfr_fits_slong_p (mpfr_t op, mp_rnd_t rnd)
82    bint mpfr_fits_uint_p (mpfr_t op, mp_rnd_t rnd)
83    bint mpfr_fits_sint_p (mpfr_t op, mp_rnd_t rnd)
84    bint mpfr_fits_ushort_p (mpfr_t op, mp_rnd_t rnd)
85    bint mpfr_fits_sshort_p (mpfr_t op, mp_rnd_t rnd)
86    bint mpfr_fits_intmax_p (mpfr_t op, mp_rnd_t rnd)
87    bint mpfr_fits_uintmax_p (mpfr_t op, mp_rnd_t rnd)
88
89    # Basic Arithmetic Functions
90    int mpfr_add (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
91    int mpfr_add_ui (mpfr_t rop, mpfr_t op1, unsigned long int op2, mp_rnd_t rnd)
92    int mpfr_add_si (mpfr_t rop, mpfr_t op1, long int op2, mp_rnd_t rnd)
93    int mpfr_add_z (mpfr_t rop, mpfr_t op1, mpz_t op2, mp_rnd_t rnd)
94    int mpfr_add_q (mpfr_t rop, mpfr_t op1, mpq_t op2, mp_rnd_t rnd)
95    int mpfr_sub (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
96    int mpfr_ui_sub (mpfr_t rop, unsigned long int op1, mpfr_t op2, mp_rnd_t rnd)
97    int mpfr_sub_ui (mpfr_t rop, mpfr_t op1, unsigned long int op2, mp_rnd_t rnd)
98    int mpfr_si_sub (mpfr_t rop, long int op1, mpfr_t op2, mp_rnd_t rnd)
99    int mpfr_sub_si (mpfr_t rop, mpfr_t op1, long int op2, mp_rnd_t rnd)
100    int mpfr_sub_z (mpfr_t rop, mpfr_t op1, mpz_t op2, mp_rnd_t rnd)
101    int mpfr_sub_q (mpfr_t rop, mpfr_t op1, mpq_t op2, mp_rnd_t rnd)
102    int mpfr_mul (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
103    int mpfr_mul_ui (mpfr_t rop, mpfr_t op1, unsigned long int op2, mp_rnd_t rnd)
104    int mpfr_mul_si (mpfr_t rop, mpfr_t op1, long int op2, mp_rnd_t rnd)
105    int mpfr_mul_z (mpfr_t rop, mpfr_t op1, mpz_t op2, mp_rnd_t rnd)
106    int mpfr_mul_q (mpfr_t rop, mpfr_t op1, mpq_t op2, mp_rnd_t rnd)
107    int mpfr_sqr (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
108    int mpfr_div (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
109    int mpfr_ui_div (mpfr_t rop, unsigned long int op1, mpfr_t op2, mp_rnd_t rnd)
110    int mpfr_div_ui (mpfr_t rop, mpfr_t op1, unsigned long int op2, mp_rnd_t rnd)
111    int mpfr_si_div (mpfr_t rop, long int op1, mpfr_t op2, mp_rnd_t rnd)
112    int mpfr_div_si (mpfr_t rop, mpfr_t op1, long int op2, mp_rnd_t rnd)
113    int mpfr_div_z (mpfr_t rop, mpfr_t op1, mpz_t op2, mp_rnd_t rnd)
114    int mpfr_div_q (mpfr_t rop, mpfr_t op1, mpq_t op2, mp_rnd_t rnd)
115    int mpfr_sqrt (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
116    int mpfr_sqrt_ui (mpfr_t rop, unsigned long int op, mp_rnd_t rnd)
117    int mpfr_cbrt (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
118    int mpfr_root (mpfr_t rop, mpfr_t op, unsigned long int k, mp_rnd_t rnd)
119    int mpfr_pow (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
120    int mpfr_pow_ui (mpfr_t rop, mpfr_t op1, unsigned long int op2, mp_rnd_t rnd)
121    int mpfr_pow_si (mpfr_t rop, mpfr_t op1, long int op2, mp_rnd_t rnd)
122    int mpfr_pow_z (mpfr_t rop, mpfr_t op1, mpz_t op2, mp_rnd_t rnd)
123    int mpfr_ui_pow_ui (mpfr_t rop, unsigned long int op1, unsigned long int op2, mp_rnd_t rnd)
124    int mpfr_ui_pow (mpfr_t rop, unsigned long int op1, mpfr_t op2, mp_rnd_t rnd)
125    int mpfr_neg (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
126    int mpfr_abs (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
127    int mpfr_dim (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
128    int mpfr_mul_2ui (mpfr_t rop, mpfr_t op1, unsigned long int op2, mp_rnd_t rnd)
129    int mpfr_mul_2si (mpfr_t rop, mpfr_t op1, long int op2, mp_rnd_t rnd)
130    int mpfr_div_2ui (mpfr_t rop, mpfr_t op1, unsigned long int op2, mp_rnd_t rnd)
131    int mpfr_div_2si (mpfr_t rop, mpfr_t op1, long int op2, mp_rnd_t rnd)
132
133    # Comparison Functions
134    int mpfr_cmp (mpfr_t op1, mpfr_t op2)
135    int mpfr_cmp_ui (mpfr_t op1, unsigned long int op2)
136    int mpfr_cmp_si (mpfr_t op1, signed long int op2)
137    int mpfr_cmp_d (mpfr_t op1, double op2)
138    int mpfr_cmp_ld (mpfr_t op1, long double op2)
139    int mpfr_cmp_z (mpfr_t op1, mpz_t op2)
140    int mpfr_cmp_q (mpfr_t op1, mpq_t op2)
141    # int mpfr_cmp_f (mpfr_t op1, mpf_t op2)
142    int mpfr_cmp_ui_2exp (mpfr_t op1, unsigned long int op2, mp_exp_t e)
143    int mpfr_cmp_si_2exp (mpfr_t op1, long int op2, mp_exp_t e)
144    int mpfr_cmpabs (mpfr_t op1, mpfr_t op2)
145    bint mpfr_nan_p (mpfr_t op)
146    bint mpfr_inf_p (mpfr_t op)
147    bint mpfr_number_p (mpfr_t op)
148    bint mpfr_zero_p (mpfr_t op)
149    bint mpfr_regular_p (mpfr_t op)
150    int mpfr_sgn (mpfr_t op)
151    bint mpfr_greater_p (mpfr_t op1, mpfr_t op2)
152    bint mpfr_greaterequal_p (mpfr_t op1, mpfr_t op2)
153    bint mpfr_less_p (mpfr_t op1, mpfr_t op2)
154    bint mpfr_lessequal_p (mpfr_t op1, mpfr_t op2)
155    bint mpfr_lessgreater_p (mpfr_t op1, mpfr_t op2)
156    bint mpfr_equal_p (mpfr_t op1, mpfr_t op2)
157    bint mpfr_unordered_p (mpfr_t op1, mpfr_t op2)
158
159    # Special Functions
160    int mpfr_log (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
161    int mpfr_log2 (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
162    int mpfr_log10 (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
163    int mpfr_exp (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
164    int mpfr_exp2 (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
165    int mpfr_exp10 (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
166    int mpfr_cos (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
167    int mpfr_sin (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
168    int mpfr_tan (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
169    int mpfr_sec (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
170    int mpfr_csc (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
171    int mpfr_cot (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
172    int mpfr_sin_cos (mpfr_t sop, mpfr_t cop, mpfr_t op, mp_rnd_t rnd)
173    int mpfr_acos (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
174    int mpfr_asin (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
175    int mpfr_atan (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
176    int mpfr_atan2 (mpfr_t rop, mpfr_t y, mpfr_t x, mp_rnd_t rnd)
177    int mpfr_cosh (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
178    int mpfr_sinh (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
179    int mpfr_tanh (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
180    int mpfr_sech (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
181    int mpfr_csch (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
182    int mpfr_coth (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
183    int mpfr_acosh (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
184    int mpfr_asinh (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
185    int mpfr_atanh (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
186    int mpfr_fac_ui (mpfr_t rop, unsigned long int op, mp_rnd_t rnd)
187    int mpfr_log1p (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
188    int mpfr_expm1 (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
189    int mpfr_eint (mpfr_t y, mpfr_t x, mp_rnd_t rnd)
190    int mpfr_li2 (mpfr_t y, mpfr_t x, mp_rnd_t rnd)
191    int mpfr_gamma (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
192    int mpfr_lngamma (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
193    int mpfr_lgamma (mpfr_t rop, int *signp, mpfr_t op, mp_rnd_t rnd)
194    int mpfr_zeta (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
195    int mpfr_zeta_ui (mpfr_t rop, unsigned long op, mp_rnd_t rnd)
196    int mpfr_erf (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
197    int mpfr_erfc (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
198    int mpfr_j0 (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
199    int mpfr_j1 (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
200    int mpfr_jn (mpfr_t rop, long n, mpfr_t op, mp_rnd_t rnd)
201    int mpfr_y0 (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
202    int mpfr_y1 (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
203    int mpfr_yn (mpfr_t rop, long n, mpfr_t op, mp_rnd_t rnd)
204    int mpfr_fma (mpfr_t rop, mpfr_t op1, mpfr_t op2, mpfr_t op3, mp_rnd_t rnd)
205    int mpfr_fms (mpfr_t rop, mpfr_t op1, mpfr_t op2, mpfr_t op3, mp_rnd_t rnd)
206    int mpfr_agm (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
207    int mpfr_hypot (mpfr_t rop, mpfr_t x, mpfr_t y, mp_rnd_t rnd)
208    int mpfr_const_log2 (mpfr_t rop, mp_rnd_t rnd)
209    int mpfr_const_pi (mpfr_t rop, mp_rnd_t rnd)
210    int mpfr_const_euler (mpfr_t rop, mp_rnd_t rnd)
211    int mpfr_const_catalan (mpfr_t rop, mp_rnd_t rnd)
212    void mpfr_free_cache ()
213    int mpfr_sum (mpfr_t rop, mpfr_ptr tab[], unsigned long n, mp_rnd_t rnd)
214
215    # Input and Output Functions
216    # size_t mpfr_out_str (file *stream, int base, size_t n, mpfr_t op, mp_rnd_t rnd)
217    # size_t mpfr_inp_str (mpfr_t rop, file *stream, int base, mp_rnd_t rnd)
218
219    # Integer Related Functions
220    int mpfr_rint (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
221    int mpfr_ceil (mpfr_t rop, mpfr_t op)
222    int mpfr_floor (mpfr_t rop, mpfr_t op)
223    int mpfr_round (mpfr_t rop, mpfr_t op)
224    int mpfr_trunc (mpfr_t rop, mpfr_t op)
225    int mpfr_rint_ceil (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
226    int mpfr_rint_floor (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
227    int mpfr_rint_round (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
228    int mpfr_rint_trunc (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
229    int mpfr_frac (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
230    int mpfr_remainder (mpfr_t r, mpfr_t x, mpfr_t y, mp_rnd_t rnd)
231    int mpfr_remquo (mpfr_t r, long* q, mpfr_t x, mpfr_t y, mp_rnd_t rnd)
232    bint mpfr_integer_p (mpfr_t op)
233
234    # Miscellaneous Functions
235    void mpfr_nexttoward (mpfr_t x, mpfr_t y)
236    void mpfr_nextabove (mpfr_t x)
237    void mpfr_nextbelow (mpfr_t x)
238    int mpfr_min (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
239    int mpfr_max (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
240    int mpfr_urandomb (mpfr_t rop, gmp_randstate_t state)
241    void mpfr_random (mpfr_t rop)
242    void mpfr_random2 (mpfr_t rop, mp_size_t size, mp_exp_t exp)
243    mp_exp_t mpfr_get_exp (mpfr_t x)
244    int mpfr_set_exp (mpfr_t x, mp_exp_t e)
245    int mpfr_signbit (mpfr_t op)
246    int mpfr_setsign (mpfr_t rop, mpfr_t op, int s, mp_rnd_t rnd)
247    int mpfr_copysign (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
248    char * mpfr_get_version ()
249    long MPFR_VERSION_NUM (major, minor, patchlevel)
250    char * mpfr_get_patches ()
251
252    # Printf-Like Functions
253    int mpfr_printf (const char*, ...)
254    int mpfr_asprintf (char**, const char*, ...)
255    int mpfr_sprintf (char**, const char*, ...)
256    int mpfr_snprintf (char*, size_t, const char*, ...)
257
258    # Rounding Mode Related Functions
259    void mpfr_set_default_rounding_mode (mp_rnd_t rnd)
260    mp_rnd_t mpfr_get_default_rounding_mode ()
261    int mpfr_prec_round (mpfr_t x, mp_prec_t prec, mp_rnd_t rnd)
262    int mpfr_round_prec (mpfr_t x, mp_rnd_t rnd, mp_prec_t prec)
263    char * mpfr_print_rnd_mode (mp_rnd_t rnd)
264
265    # Exception Related Functions
266    mp_exp_t mpfr_get_emin ()
267    mp_exp_t mpfr_get_emax ()
268    int mpfr_set_emin (mp_exp_t exp)
269    int mpfr_set_emax (mp_exp_t exp)
270    mp_exp_t mpfr_get_emin_min ()
271    mp_exp_t mpfr_get_emin_max ()
272    mp_exp_t mpfr_get_emax_min ()
273    mp_exp_t mpfr_get_emax_max ()
274    int mpfr_check_range (mpfr_t x, int t, mp_rnd_t rnd)
275    int mpfr_subnormalize (mpfr_t x, int t, mp_rnd_t rnd)
276    void mpfr_clear_underflow ()
277    void mpfr_clear_overflow ()
278    void mpfr_clear_nanflag ()
279    void mpfr_clear_inexflag ()
280    void mpfr_clear_erangeflag ()
281    void mpfr_set_underflow ()
282    void mpfr_set_overflow ()
283    void mpfr_set_nanflag ()
284    void mpfr_set_inexflag ()
285    void mpfr_set_erangeflag ()
286    void mpfr_clear_flags ()
287    bint mpfr_underflow_p ()
288    bint mpfr_overflow_p ()
289    bint mpfr_nanflag_p ()
290    bint mpfr_inexflag_p ()
291    bint mpfr_erangeflag_p ()
292
293    # Advanced Functions
294    MPFR_DECL_INIT (name, prec)
295    void mpfr_inits (mpfr_t x, ...)
296    void mpfr_inits2 (mp_prec_t prec, mpfr_t x, ...)
297    void mpfr_clears (mpfr_t x, ...)
298
299    # Compatibility With MPF
300    void mpfr_set_prec_raw (mpfr_t x, mp_prec_t prec)
301    int mpfr_eq (mpfr_t op1, mpfr_t op2, unsigned long int op3)
302    void mpfr_reldiff (mpfr_t rop, mpfr_t op1, mpfr_t op2, mp_rnd_t rnd)
303    int mpfr_mul_2exp (mpfr_t rop, mpfr_t op1, unsigned long int op2, mp_rnd_t rnd)
304    int mpfr_div_2exp (mpfr_t rop, mpfr_t op1, unsigned long int op2, mp_rnd_t rnd)
305
306    # Custom Interface
307    size_t mpfr_custom_get_size (mp_prec_t prec)
308    void mpfr_custom_init (void *significand, mp_prec_t prec)
309    void mpfr_custom_init_set (mpfr_t x, int kind, mp_exp_t exp, mp_prec_t prec, void *significand)
310    int mpfr_custom_get_kind (mpfr_t x)
311    void * mpfr_custom_get_mantissa (mpfr_t x)
312    mp_exp_t mpfr_custom_get_exp (mpfr_t x)
313    void mpfr_custom_move (mpfr_t x, void *new_position)
314
315    # Internals
316    int mpfr_can_round (mpfr_t b, mp_exp_t err, mp_rnd_t rnd1, mp_rnd_t rnd2, mp_prec_t prec)
317    double mpfr_get_d1 (mpfr_t op)
318