Home | History | Annotate | Download | only in include
      1 /* mpf2mpfr.h -- Compatibility include file with mpf.
      2 
      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.
      5 
      6 This file is part of the GNU MPFR Library.
      7 
      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.
     12 
     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.
     17 
     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. */
     22 
     23 #ifndef __MPFR_FROM_MPF__
     24 #define __MPFR_FROM_MFF__
     25 
     26 /* types */
     27 #define mpf_t mpfr_t
     28 #define mpf_srcptr mpfr_srcptr
     29 #define mpf_ptr mpfr_ptr
     30 
     31 /* Get current Rounding Mode */
     32 #ifndef MPFR_DEFAULT_RND
     33 # define MPFR_DEFAULT_RND mpfr_get_default_rounding_mode ()
     34 #endif
     35 
     36 /* mpf_init initalizes at 0 */
     37 #undef mpf_init
     38 #define mpf_init(x) mpfr_init_set_ui ((x), 0, MPFR_DEFAULT_RND)
     39 #undef mpf_init2
     40 #define mpf_init2(x,p) (mpfr_init2((x),(p)), mpfr_set_ui ((x), 0, MPFR_DEFAULT_RND))
     41 
     42 /* functions which don't take as argument the rounding mode */
     43 #undef mpf_ceil
     44 #define mpf_ceil mpfr_ceil
     45 #undef mpf_clear
     46 #define mpf_clear mpfr_clear
     47 #undef mpf_cmp
     48 #define mpf_cmp mpfr_cmp
     49 #undef mpf_cmp_si
     50 #define mpf_cmp_si mpfr_cmp_si
     51 #undef mpf_cmp_ui
     52 #define mpf_cmp_ui mpfr_cmp_ui
     53 #undef mpf_cmp_d
     54 #define mpf_cmp_d mpfr_cmp_d
     55 #undef mpf_eq
     56 #define mpf_eq mpfr_eq
     57 #undef mpf_floor
     58 #define mpf_floor mpfr_floor
     59 #undef mpf_get_prec
     60 #define mpf_get_prec mpfr_get_prec
     61 #undef mpf_integer_p
     62 #define mpf_integer_p mpfr_integer_p
     63 #undef mpf_random2
     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
     69 #undef mpf_set_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)
     73 #undef mpf_trunc
     74 #define mpf_trunc mpfr_trunc
     75 #undef mpf_sgn
     76 #define mpf_sgn mpfr_sgn
     77 #undef mpf_swap
     78 #define mpf_swap mpfr_swap
     79 #undef mpf_dump
     80 #define mpf_dump mpfr_dump
     81 
     82 /* functions which take as argument the rounding mode */
     83 #undef mpf_abs
     84 #define mpf_abs(x,y) mpfr_abs(x,y,MPFR_DEFAULT_RND)
     85 #undef mpf_add
     86 #define mpf_add(x,y,z) mpfr_add(x,y,z,MPFR_DEFAULT_RND)
     87 #undef mpf_add_ui
     88 #define mpf_add_ui(x,y,z) mpfr_add_ui(x,y,z,MPFR_DEFAULT_RND)
     89 #undef mpf_div
     90 #define mpf_div(x,y,z) mpfr_div(x,y,z,MPFR_DEFAULT_RND)
     91 #undef mpf_div_ui
     92 #define mpf_div_ui(x,y,z) mpfr_div_ui(x,y,z,MPFR_DEFAULT_RND)
     93 #undef mpf_div_2exp
     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)
    107 #undef mpf_get_str
    108 #define mpf_get_str(x,y,z,t,u) mpfr_get_str(x,y,z,t,u,MPFR_DEFAULT_RND)
    109 #undef mpf_get_d
    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)
    113 #undef mpf_get_ui
    114 #define mpf_get_ui(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
    115 #undef mpf_get_si
    116 #define mpf_get_si(x) mpfr_get_ui(x,MPFR_DEFAULT_RND)
    117 #undef mpf_inp_str
    118 #define mpf_inp_str(x,y,z) mpfr_inp_str(x,y,z,MPFR_DEFAULT_RND)
    119 #undef mpf_set_str
    120 #define mpf_set_str(x,y,z) mpfr_set_str(x,y,z,MPFR_DEFAULT_RND)
    121 #undef mpf_init_set
    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)
    131 #undef mpf_mul
    132 #define mpf_mul(x,y,z) mpfr_mul(x,y,z,MPFR_DEFAULT_RND)
    133 #undef mpf_mul_2exp
    134 #define mpf_mul_2exp(x,y,z) mpfr_mul_2exp(x,y,z,MPFR_DEFAULT_RND)
    135 #undef mpf_mul_ui
    136 #define mpf_mul_ui(x,y,z) mpfr_mul_ui(x,y,z,MPFR_DEFAULT_RND)
    137 #undef mpf_neg
    138 #define mpf_neg(x,y) mpfr_neg(x,y,MPFR_DEFAULT_RND)
    139 #undef mpf_out_str
    140 #define mpf_out_str(x,y,z,t) mpfr_out_str(x,y,z,t,MPFR_DEFAULT_RND)
    141 #undef mpf_pow_ui
    142 #define mpf_pow_ui(x,y,z) mpfr_pow_ui(x,y,z,MPFR_DEFAULT_RND)
    143 #undef mpf_reldiff
    144 #define mpf_reldiff(x,y,z) mpfr_reldiff(x,y,z,MPFR_DEFAULT_RND)
    145 #undef mpf_set
    146 #define mpf_set(x,y) mpfr_set(x,y,MPFR_DEFAULT_RND)
    147 #undef mpf_set_d
    148 #define mpf_set_d(x,y) mpfr_set_d(x,y,MPFR_DEFAULT_RND)
    149 #undef mpf_set_q
    150 #define mpf_set_q(x,y) mpfr_set_q(x,y,MPFR_DEFAULT_RND)
    151 #undef mpf_set_si
    152 #define mpf_set_si(x,y) mpfr_set_si(x,y,MPFR_DEFAULT_RND)
    153 #undef mpf_set_ui
    154 #define mpf_set_ui(x,y) mpfr_set_ui(x,y,MPFR_DEFAULT_RND)
    155 #undef mpf_set_z
    156 #define mpf_set_z(x,y) mpfr_set_z(x,y,MPFR_DEFAULT_RND)
    157 #undef mpf_sqrt
    158 #define mpf_sqrt(x,y) mpfr_sqrt(x,y,MPFR_DEFAULT_RND)
    159 #undef mpf_sqrt_ui
    160 #define mpf_sqrt_ui(x,y) mpfr_sqrt_ui(x,y,MPFR_DEFAULT_RND)
    161 #undef mpf_sub
    162 #define mpf_sub(x,y,z) mpfr_sub(x,y,z,MPFR_DEFAULT_RND)
    163 #undef mpf_sub_ui
    164 #define mpf_sub_ui(x,y,z) mpfr_sub_ui(x,y,z,MPFR_DEFAULT_RND)
    165 #undef mpf_ui_div
    166 #define mpf_ui_div(x,y,z) mpfr_ui_div(x,y,z,MPFR_DEFAULT_RND)
    167 #undef mpf_ui_sub
    168 #define mpf_ui_sub(x,y,z) mpfr_ui_sub(x,y,z,MPFR_DEFAULT_RND)
    169 #undef mpf_urandomb
    170 #define mpf_urandomb(x,y,n) mpfr_urandomb(x,y)
    171 
    172 #endif
    173