mpf2mpfr.h 6.1 KB

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