Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/mpf2mpfr.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* mpf2mpfr.h -- Compatibility include file with mpf.
0002 
0003 Copyright 1999-2002, 2004-2023 Free Software Foundation, Inc.
0004 Contributed by the AriC and Caramba projects, INRIA.
0005 
0006 This file is part of the GNU MPFR Library.
0007 
0008 The GNU MPFR Library is free software; you can redistribute it and/or modify
0009 it under the terms of the GNU Lesser General Public License as published by
0010 the Free Software Foundation; either version 3 of the License, or (at your
0011 option) any later version.
0012 
0013 The GNU MPFR Library is distributed in the hope that it will be useful, but
0014 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
0015 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
0016 License for more details.
0017 
0018 You should have received a copy of the GNU Lesser General Public License
0019 along with the GNU MPFR Library; see the file COPYING.LESSER.  If not, see
0020 https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
0021 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
0022 
0023 #ifndef __MPFR_FROM_MPF__
0024 #define __MPFR_FROM_MPF__
0025 
0026 /* types */
0027 #define mpf_t mpfr_t
0028 #define mpf_srcptr mpfr_srcptr
0029 #define mpf_ptr mpfr_ptr
0030 
0031 /* Get current Rounding Mode */
0032 #ifndef MPFR_DEFAULT_RND
0033 # define MPFR_DEFAULT_RND mpfr_get_default_rounding_mode ()
0034 #endif
0035 
0036 /* mpf_init initializes at 0 */
0037 #undef mpf_init
0038 #define mpf_init(x) mpfr_init_set_ui ((x), 0, MPFR_DEFAULT_RND)
0039 #undef mpf_init2
0040 #define mpf_init2(x,p) (mpfr_init2((x),(p)), mpfr_set_ui ((x), 0, MPFR_DEFAULT_RND))
0041 
0042 /* Warning! This assumes that all pointer types have the same representation. */
0043 #undef mpf_inits
0044 #define mpf_inits mpfr_inits
0045 #undef mpf_clears
0046 #define mpf_clears mpfr_clears
0047 
0048 /* functions which don't take as argument the rounding mode */
0049 #undef mpf_ceil
0050 #define mpf_ceil mpfr_ceil
0051 #undef mpf_clear
0052 #define mpf_clear mpfr_clear
0053 #undef mpf_cmp
0054 #define mpf_cmp mpfr_cmp
0055 #undef mpf_cmp_si
0056 #define mpf_cmp_si mpfr_cmp_si
0057 #undef mpf_cmp_ui
0058 #define mpf_cmp_ui mpfr_cmp_ui
0059 #undef mpf_cmp_d
0060 #define mpf_cmp_d mpfr_cmp_d
0061 /* mpf_cmp_z appeared in GMP 6.1.0 */
0062 #if __GNU_MP_VERSION > 6 || (__GNU_MP_VERSION == 6 && __GNU_MP_VERSION_MINOR >= 1)
0063 #undef mpf_cmp_z
0064 #define mpf_cmp_z mpfr_cmp_z
0065 #endif
0066 #undef mpf_eq
0067 #define mpf_eq mpfr_eq
0068 #undef mpf_floor
0069 #define mpf_floor mpfr_floor
0070 #undef mpf_get_prec
0071 #define mpf_get_prec mpfr_get_prec
0072 #undef mpf_integer_p
0073 #define mpf_integer_p mpfr_integer_p
0074 #undef mpf_random2
0075 #define mpf_random2 mpfr_random2
0076 #undef mpf_set_default_prec
0077 #define mpf_set_default_prec mpfr_set_default_prec
0078 #undef mpf_get_default_prec
0079 #define mpf_get_default_prec mpfr_get_default_prec
0080 #undef mpf_set_prec
0081 #define mpf_set_prec mpfr_set_prec
0082 #undef mpf_set_prec_raw
0083 #define mpf_set_prec_raw(x,p) mpfr_prec_round(x,p,MPFR_DEFAULT_RND)
0084 #undef mpf_trunc
0085 #define mpf_trunc mpfr_trunc
0086 #undef mpf_sgn
0087 #define mpf_sgn mpfr_sgn
0088 #undef mpf_swap
0089 #define mpf_swap mpfr_swap
0090 #undef mpf_dump
0091 #define mpf_dump mpfr_dump
0092 
0093 /* functions which take as argument the rounding mode */
0094 #undef mpf_abs
0095 #define mpf_abs(x,y) mpfr_abs(x,y,MPFR_DEFAULT_RND)
0096 #undef mpf_add
0097 #define mpf_add(x,y,z) mpfr_add(x,y,z,MPFR_DEFAULT_RND)
0098 #undef mpf_add_ui
0099 #define mpf_add_ui(x,y,z) mpfr_add_ui(x,y,z,MPFR_DEFAULT_RND)
0100 #undef mpf_div
0101 #define mpf_div(x,y,z) mpfr_div(x,y,z,MPFR_DEFAULT_RND)
0102 #undef mpf_div_ui
0103 #define mpf_div_ui(x,y,z) mpfr_div_ui(x,y,z,MPFR_DEFAULT_RND)
0104 #undef mpf_div_2exp
0105 #define mpf_div_2exp(x,y,z) mpfr_div_2exp(x,y,z,MPFR_DEFAULT_RND)
0106 #undef mpf_fits_slong_p
0107 #define mpf_fits_slong_p(x) mpfr_fits_slong_p(x,MPFR_DEFAULT_RND)
0108 #undef mpf_fits_ulong_p
0109 #define mpf_fits_ulong_p(x) mpfr_fits_ulong_p(x,MPFR_DEFAULT_RND)
0110 #undef mpf_fits_sint_p
0111 #define mpf_fits_sint_p(x) mpfr_fits_sint_p(x,MPFR_DEFAULT_RND)
0112 #undef mpf_fits_uint_p
0113 #define mpf_fits_uint_p(x) mpfr_fits_uint_p(x,MPFR_DEFAULT_RND)
0114 #undef mpf_fits_sshort_p
0115 #define mpf_fits_sshort_p(x) mpfr_fits_sshort_p(x,MPFR_DEFAULT_RND)
0116 #undef mpf_fits_ushort_p
0117 #define mpf_fits_ushort_p(x) mpfr_fits_ushort_p(x,MPFR_DEFAULT_RND)
0118 #undef mpf_get_str
0119 #define mpf_get_str(x,y,z,t,u) mpfr_get_str(x,y,z,t,u,MPFR_DEFAULT_RND)
0120 #undef mpf_get_d
0121 #define mpf_get_d(x) mpfr_get_d(x,MPFR_DEFAULT_RND)
0122 #undef mpf_get_d_2exp
0123 #define mpf_get_d_2exp(e,x) mpfr_get_d_2exp(e,x,MPFR_DEFAULT_RND)
0124 #undef mpf_get_ui
0125 #define mpf_get_ui(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
0126 #undef mpf_get_si
0127 #define mpf_get_si(x) mpfr_get_si(x,MPFR_DEFAULT_RND)
0128 #undef mpf_inp_str
0129 #define mpf_inp_str(x,y,z) mpfr_inp_str(x,y,z,MPFR_DEFAULT_RND)
0130 #undef mpf_set_str
0131 #define mpf_set_str(x,y,z) mpfr_set_str(x,y,z,MPFR_DEFAULT_RND)
0132 #undef mpf_init_set
0133 #define mpf_init_set(x,y) mpfr_init_set(x,y,MPFR_DEFAULT_RND)
0134 #undef mpf_init_set_d
0135 #define mpf_init_set_d(x,y) mpfr_init_set_d(x,y,MPFR_DEFAULT_RND)
0136 #undef mpf_init_set_si
0137 #define mpf_init_set_si(x,y) mpfr_init_set_si(x,y,MPFR_DEFAULT_RND)
0138 #undef mpf_init_set_str
0139 #define mpf_init_set_str(x,y,z) mpfr_init_set_str(x,y,z,MPFR_DEFAULT_RND)
0140 #undef mpf_init_set_ui
0141 #define mpf_init_set_ui(x,y) mpfr_init_set_ui(x,y,MPFR_DEFAULT_RND)
0142 #undef mpf_mul
0143 #define mpf_mul(x,y,z) mpfr_mul(x,y,z,MPFR_DEFAULT_RND)
0144 #undef mpf_mul_2exp
0145 #define mpf_mul_2exp(x,y,z) mpfr_mul_2exp(x,y,z,MPFR_DEFAULT_RND)
0146 #undef mpf_mul_ui
0147 #define mpf_mul_ui(x,y,z) mpfr_mul_ui(x,y,z,MPFR_DEFAULT_RND)
0148 #undef mpf_neg
0149 #define mpf_neg(x,y) mpfr_neg(x,y,MPFR_DEFAULT_RND)
0150 #undef mpf_out_str
0151 #define mpf_out_str(x,y,z,t) mpfr_out_str(x,y,z,t,MPFR_DEFAULT_RND)
0152 #undef mpf_pow_ui
0153 #define mpf_pow_ui(x,y,z) mpfr_pow_ui(x,y,z,MPFR_DEFAULT_RND)
0154 #undef mpf_reldiff
0155 #define mpf_reldiff(x,y,z) mpfr_reldiff(x,y,z,MPFR_DEFAULT_RND)
0156 #undef mpf_set
0157 #define mpf_set(x,y) mpfr_set(x,y,MPFR_DEFAULT_RND)
0158 #undef mpf_set_d
0159 #define mpf_set_d(x,y) mpfr_set_d(x,y,MPFR_DEFAULT_RND)
0160 #undef mpf_set_q
0161 #define mpf_set_q(x,y) mpfr_set_q(x,y,MPFR_DEFAULT_RND)
0162 #undef mpf_set_si
0163 #define mpf_set_si(x,y) mpfr_set_si(x,y,MPFR_DEFAULT_RND)
0164 #undef mpf_set_ui
0165 #define mpf_set_ui(x,y) mpfr_set_ui(x,y,MPFR_DEFAULT_RND)
0166 #undef mpf_set_z
0167 #define mpf_set_z(x,y) mpfr_set_z(x,y,MPFR_DEFAULT_RND)
0168 #undef mpf_sqrt
0169 #define mpf_sqrt(x,y) mpfr_sqrt(x,y,MPFR_DEFAULT_RND)
0170 #undef mpf_sqrt_ui
0171 #define mpf_sqrt_ui(x,y) mpfr_sqrt_ui(x,y,MPFR_DEFAULT_RND)
0172 #undef mpf_sub
0173 #define mpf_sub(x,y,z) mpfr_sub(x,y,z,MPFR_DEFAULT_RND)
0174 #undef mpf_sub_ui
0175 #define mpf_sub_ui(x,y,z) mpfr_sub_ui(x,y,z,MPFR_DEFAULT_RND)
0176 #undef mpf_ui_div
0177 #define mpf_ui_div(x,y,z) mpfr_ui_div(x,y,z,MPFR_DEFAULT_RND)
0178 #undef mpf_ui_sub
0179 #define mpf_ui_sub(x,y,z) mpfr_ui_sub(x,y,z,MPFR_DEFAULT_RND)
0180 #undef mpf_urandomb
0181 #define mpf_urandomb(x,y,n) mpfr_urandomb(x,y)
0182 
0183 #undef mpz_set_f
0184 #define mpz_set_f(z,f) mpfr_get_z(z,f,MPFR_DEFAULT_RND)
0185 #undef mpq_set_f
0186 #define mpq_set_f(q,f) mpfr_get_q(q,f)
0187 
0188 #endif /* __MPFR_FROM_MPF__ */