1 /* mpf2mpfr.h -- Compatibility include file with mpf.
3 Copyright 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
4 Contributed by the Arenaire and Cacao projects, INRIA.
6 This file is part of the GNU MPFR Library.
8 The GNU MPFR Library is free software; you can redistribute it and/or modify
9 it under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or (at your
11 option) any later version.
13 The GNU MPFR Library is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with the GNU MPFR Library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21 MA 02110-1301, USA. */
23 #ifndef __MPFR_FROM_MPF__
24 #define __MPFR_FROM_MPF__
28 #define mpf_srcptr mpfr_srcptr
29 #define mpf_ptr mpfr_ptr
31 /* Get current Rounding Mode */
32 #ifndef MPFR_DEFAULT_RND
33 # define MPFR_DEFAULT_RND mpfr_get_default_rounding_mode ()
36 /* mpf_init initalizes at 0 */
38 #define mpf_init(x) mpfr_init_set_ui ((x), 0, MPFR_DEFAULT_RND)
40 #define mpf_init2(x,p) (mpfr_init2((x),(p)), mpfr_set_ui ((x), 0, MPFR_DEFAULT_RND))
42 /* functions which don't take as argument the rounding mode */
44 #define mpf_ceil mpfr_ceil
46 #define mpf_clear mpfr_clear
48 #define mpf_cmp mpfr_cmp
50 #define mpf_cmp_si mpfr_cmp_si
52 #define mpf_cmp_ui mpfr_cmp_ui
54 #define mpf_cmp_d mpfr_cmp_d
56 #define mpf_eq mpfr_eq
58 #define mpf_floor mpfr_floor
60 #define mpf_get_prec mpfr_get_prec
62 #define mpf_integer_p mpfr_integer_p
64 #define mpf_random2 mpfr_random2
65 #undef mpf_set_default_prec
66 #define mpf_set_default_prec mpfr_set_default_prec
67 #undef mpf_get_default_prec
68 #define mpf_get_default_prec mpfr_get_default_prec
70 #define mpf_set_prec mpfr_set_prec
71 #undef mpf_set_prec_raw
72 #define mpf_set_prec_raw(x,p) mpfr_prec_round(x,p,MPFR_DEFAULT_RND)
74 #define mpf_trunc mpfr_trunc
76 #define mpf_sgn mpfr_sgn
78 #define mpf_swap mpfr_swap
80 #define mpf_dump mpfr_dump
82 /* functions which take as argument the rounding mode */
84 #define mpf_abs(x,y) mpfr_abs(x,y,MPFR_DEFAULT_RND)
86 #define mpf_add(x,y,z) mpfr_add(x,y,z,MPFR_DEFAULT_RND)
88 #define mpf_add_ui(x,y,z) mpfr_add_ui(x,y,z,MPFR_DEFAULT_RND)
90 #define mpf_div(x,y,z) mpfr_div(x,y,z,MPFR_DEFAULT_RND)
92 #define mpf_div_ui(x,y,z) mpfr_div_ui(x,y,z,MPFR_DEFAULT_RND)
94 #define mpf_div_2exp(x,y,z) mpfr_div_2exp(x,y,z,MPFR_DEFAULT_RND)
95 #undef mpf_fits_slong_p
96 #define mpf_fits_slong_p(x) mpfr_fits_ulong_p(x,MPFR_DEFAULT_RND)
97 #undef mpf_fits_ulong_p
98 #define mpf_fits_ulong_p(x) mpfr_fits_ulong_p(x,MPFR_DEFAULT_RND)
99 #undef mpf_fits_sint_p
100 #define mpf_fits_sint_p(x) mpfr_fits_uint_p(x,MPFR_DEFAULT_RND)
101 #undef mpf_fits_uint_p
102 #define mpf_fits_uint_p(x) mpfr_fits_uint_p(x,MPFR_DEFAULT_RND)
103 #undef mpf_fits_sshort_p
104 #define mpf_fits_sshort_p(x) mpfr_fits_ushort_p(x,MPFR_DEFAULT_RND)
105 #undef mpf_fits_ushort_p
106 #define mpf_fits_ushort_p(x) mpfr_fits_ushort_p(x,MPFR_DEFAULT_RND)
108 #define mpf_get_str(x,y,z,t,u) mpfr_get_str(x,y,z,t,u,MPFR_DEFAULT_RND)
110 #define mpf_get_d(x) mpfr_get_d(x,MPFR_DEFAULT_RND)
111 #undef mpf_get_d_2exp
112 #define mpf_get_d_2exp(e,x) mpfr_get_d_2exp(e,x,MPFR_DEFAULT_RND)
114 #define mpf_get_ui(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
116 #define mpf_get_si(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
118 #define mpf_inp_str(x,y,z) mpfr_inp_str(x,y,z,MPFR_DEFAULT_RND)
120 #define mpf_set_str(x,y,z) mpfr_set_str(x,y,z,MPFR_DEFAULT_RND)
122 #define mpf_init_set(x,y) mpfr_init_set(x,y,MPFR_DEFAULT_RND)
123 #undef mpf_init_set_d
124 #define mpf_init_set_d(x,y) mpfr_init_set_d(x,y,MPFR_DEFAULT_RND)
125 #undef mpf_init_set_si
126 #define mpf_init_set_si(x,y) mpfr_init_set_si(x,y,MPFR_DEFAULT_RND)
127 #undef mpf_init_set_str
128 #define mpf_init_set_str(x,y,z) mpfr_init_set_str(x,y,z,MPFR_DEFAULT_RND)
129 #undef mpf_init_set_ui
130 #define mpf_init_set_ui(x,y) mpfr_init_set_ui(x,y,MPFR_DEFAULT_RND)
132 #define mpf_mul(x,y,z) mpfr_mul(x,y,z,MPFR_DEFAULT_RND)
134 #define mpf_mul_2exp(x,y,z) mpfr_mul_2exp(x,y,z,MPFR_DEFAULT_RND)
136 #define mpf_mul_ui(x,y,z) mpfr_mul_ui(x,y,z,MPFR_DEFAULT_RND)
138 #define mpf_neg(x,y) mpfr_neg(x,y,MPFR_DEFAULT_RND)
140 #define mpf_out_str(x,y,z,t) mpfr_out_str(x,y,z,t,MPFR_DEFAULT_RND)
142 #define mpf_pow_ui(x,y,z) mpfr_pow_ui(x,y,z,MPFR_DEFAULT_RND)
144 #define mpf_reldiff(x,y,z) mpfr_reldiff(x,y,z,MPFR_DEFAULT_RND)
146 #define mpf_set(x,y) mpfr_set(x,y,MPFR_DEFAULT_RND)
148 #define mpf_set_d(x,y) mpfr_set_d(x,y,MPFR_DEFAULT_RND)
150 #define mpf_set_q(x,y) mpfr_set_q(x,y,MPFR_DEFAULT_RND)
152 #define mpf_set_si(x,y) mpfr_set_si(x,y,MPFR_DEFAULT_RND)
154 #define mpf_set_ui(x,y) mpfr_set_ui(x,y,MPFR_DEFAULT_RND)
156 #define mpf_set_z(x,y) mpfr_set_z(x,y,MPFR_DEFAULT_RND)
158 #define mpf_sqrt(x,y) mpfr_sqrt(x,y,MPFR_DEFAULT_RND)
160 #define mpf_sqrt_ui(x,y) mpfr_sqrt_ui(x,y,MPFR_DEFAULT_RND)
162 #define mpf_sub(x,y,z) mpfr_sub(x,y,z,MPFR_DEFAULT_RND)
164 #define mpf_sub_ui(x,y,z) mpfr_sub_ui(x,y,z,MPFR_DEFAULT_RND)
166 #define mpf_ui_div(x,y,z) mpfr_ui_div(x,y,z,MPFR_DEFAULT_RND)
168 #define mpf_ui_sub(x,y,z) mpfr_ui_sub(x,y,z,MPFR_DEFAULT_RND)
170 #define mpf_urandomb(x,y,n) mpfr_urandomb(x,y)
172 #endif /* __MPFR_FROM_MPF__ */