14a238c70SJohn Marino /* mpfr.h -- Include file for mpfr. 24a238c70SJohn Marino 3*ab6d115fSJohn Marino Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. 4*ab6d115fSJohn Marino Contributed by the AriC and Caramel projects, INRIA. 54a238c70SJohn Marino 64a238c70SJohn Marino This file is part of the GNU MPFR Library. 74a238c70SJohn Marino 84a238c70SJohn Marino The GNU MPFR Library is free software; you can redistribute it and/or modify 94a238c70SJohn Marino it under the terms of the GNU Lesser General Public License as published by 104a238c70SJohn Marino the Free Software Foundation; either version 3 of the License, or (at your 114a238c70SJohn Marino option) any later version. 124a238c70SJohn Marino 134a238c70SJohn Marino The GNU MPFR Library is distributed in the hope that it will be useful, but 144a238c70SJohn Marino WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 154a238c70SJohn Marino or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 164a238c70SJohn Marino License for more details. 174a238c70SJohn Marino 184a238c70SJohn Marino You should have received a copy of the GNU Lesser General Public License 194a238c70SJohn Marino along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see 204a238c70SJohn Marino http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 214a238c70SJohn Marino 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ 224a238c70SJohn Marino 234a238c70SJohn Marino #ifndef __MPFR_H 244a238c70SJohn Marino #define __MPFR_H 254a238c70SJohn Marino 264a238c70SJohn Marino /* Define MPFR version number */ 274a238c70SJohn Marino #define MPFR_VERSION_MAJOR 3 284a238c70SJohn Marino #define MPFR_VERSION_MINOR 1 29*ab6d115fSJohn Marino #define MPFR_VERSION_PATCHLEVEL 2 30*ab6d115fSJohn Marino #define MPFR_VERSION_STRING "3.1.2" 314a238c70SJohn Marino 324a238c70SJohn Marino /* Macros dealing with MPFR VERSION */ 334a238c70SJohn Marino #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) 344a238c70SJohn Marino #define MPFR_VERSION \ 354a238c70SJohn Marino MPFR_VERSION_NUM(MPFR_VERSION_MAJOR,MPFR_VERSION_MINOR,MPFR_VERSION_PATCHLEVEL) 364a238c70SJohn Marino 374a238c70SJohn Marino /* Check if GMP is included, and try to include it (Works with local GMP) */ 384a238c70SJohn Marino #ifndef __GMP_H__ 394a238c70SJohn Marino # include <gmp.h> 404a238c70SJohn Marino #endif 414a238c70SJohn Marino 42*ab6d115fSJohn Marino /* GMP's internal __gmp_const macro has been removed on 2012-03-04: 43*ab6d115fSJohn Marino http://gmplib.org:8000/gmp/rev/d287cfaf6732 44*ab6d115fSJohn Marino const is standard and now assumed to be available. If the __gmp_const 45*ab6d115fSJohn Marino definition is no longer present in GMP, this probably means that GMP 46*ab6d115fSJohn Marino assumes that const is available; thus let's define it to const. 47*ab6d115fSJohn Marino Note: this is a temporary fix that can be backported to previous MPFR 48*ab6d115fSJohn Marino versions. In the future, __gmp_const should be replaced by const like 49*ab6d115fSJohn Marino in GMP. */ 50*ab6d115fSJohn Marino #ifndef __gmp_const 51*ab6d115fSJohn Marino # define __gmp_const const 52*ab6d115fSJohn Marino #endif 53*ab6d115fSJohn Marino 544a238c70SJohn Marino /* Avoid some problems with macro expansion if the user defines macros 554a238c70SJohn Marino with the same name as keywords. By convention, identifiers and macro 564a238c70SJohn Marino names starting with mpfr_ are reserved by MPFR. */ 574a238c70SJohn Marino typedef void mpfr_void; 584a238c70SJohn Marino typedef int mpfr_int; 594a238c70SJohn Marino typedef unsigned int mpfr_uint; 604a238c70SJohn Marino typedef long mpfr_long; 614a238c70SJohn Marino typedef unsigned long mpfr_ulong; 624a238c70SJohn Marino typedef size_t mpfr_size_t; 634a238c70SJohn Marino 644a238c70SJohn Marino /* Definition of rounding modes (DON'T USE MPFR_RNDNA!). 654a238c70SJohn Marino Warning! Changing the contents of this enum should be seen as an 664a238c70SJohn Marino interface change since the old and the new types are not compatible 674a238c70SJohn Marino (the integer type compatible with the enumerated type can even change, 684a238c70SJohn Marino see ISO C99, 6.7.2.2#4), and in Makefile.am, AGE should be set to 0. 694a238c70SJohn Marino 704a238c70SJohn Marino MPFR_RNDU must appear just before MPFR_RNDD (see 714a238c70SJohn Marino MPFR_IS_RNDUTEST_OR_RNDDNOTTEST in mpfr-impl.h). 724a238c70SJohn Marino 734a238c70SJohn Marino MPFR_RNDF has been added, though not implemented yet, in order to avoid 744a238c70SJohn Marino to break the ABI once faithful rounding gets implemented. 754a238c70SJohn Marino 764a238c70SJohn Marino If you change the order of the rounding modes, please update the routines 774a238c70SJohn Marino in texceptions.c which assume 0=RNDN, 1=RNDZ, 2=RNDU, 3=RNDD, 4=RNDA. 784a238c70SJohn Marino */ 794a238c70SJohn Marino typedef enum { 804a238c70SJohn Marino MPFR_RNDN=0, /* round to nearest, with ties to even */ 814a238c70SJohn Marino MPFR_RNDZ, /* round toward zero */ 824a238c70SJohn Marino MPFR_RNDU, /* round toward +Inf */ 834a238c70SJohn Marino MPFR_RNDD, /* round toward -Inf */ 844a238c70SJohn Marino MPFR_RNDA, /* round away from zero */ 854a238c70SJohn Marino MPFR_RNDF, /* faithful rounding (not implemented yet) */ 864a238c70SJohn Marino MPFR_RNDNA=-1 /* round to nearest, with ties away from zero (mpfr_round) */ 874a238c70SJohn Marino } mpfr_rnd_t; 884a238c70SJohn Marino 894a238c70SJohn Marino /* kept for compatibility with MPFR 2.4.x and before */ 904a238c70SJohn Marino #define GMP_RNDN MPFR_RNDN 914a238c70SJohn Marino #define GMP_RNDZ MPFR_RNDZ 924a238c70SJohn Marino #define GMP_RNDU MPFR_RNDU 934a238c70SJohn Marino #define GMP_RNDD MPFR_RNDD 944a238c70SJohn Marino 954a238c70SJohn Marino /* Note: With the following default choices for _MPFR_PREC_FORMAT and 964a238c70SJohn Marino _MPFR_EXP_FORMAT, mpfr_exp_t will be the same as [mp_exp_t] (at least 974a238c70SJohn Marino up to GMP 5). */ 984a238c70SJohn Marino 994a238c70SJohn Marino /* Define precision: 1 (short), 2 (int) or 3 (long) (DON'T USE IT!) */ 1004a238c70SJohn Marino #ifndef _MPFR_PREC_FORMAT 1014a238c70SJohn Marino # if __GMP_MP_SIZE_T_INT == 1 1024a238c70SJohn Marino # define _MPFR_PREC_FORMAT 2 1034a238c70SJohn Marino # else 1044a238c70SJohn Marino # define _MPFR_PREC_FORMAT 3 1054a238c70SJohn Marino # endif 1064a238c70SJohn Marino #endif 1074a238c70SJohn Marino 1084a238c70SJohn Marino /* Define exponent: 1 (short), 2 (int), 3 (long) or 4 (intmax_t) 1094a238c70SJohn Marino (DON'T USE IT!) */ 1104a238c70SJohn Marino #ifndef _MPFR_EXP_FORMAT 1114a238c70SJohn Marino # define _MPFR_EXP_FORMAT _MPFR_PREC_FORMAT 1124a238c70SJohn Marino #endif 1134a238c70SJohn Marino 1144a238c70SJohn Marino #if _MPFR_PREC_FORMAT > _MPFR_EXP_FORMAT 1154a238c70SJohn Marino # error "mpfr_prec_t must not be larger than mpfr_exp_t" 1164a238c70SJohn Marino #endif 1174a238c70SJohn Marino 1184a238c70SJohn Marino /* Let's make mpfr_prec_t signed in order to avoid problems due to the 1194a238c70SJohn Marino usual arithmetic conversions when mixing mpfr_prec_t and mpfr_exp_t 1204a238c70SJohn Marino in an expression (for error analysis) if casts are forgotten. */ 1214a238c70SJohn Marino #if _MPFR_PREC_FORMAT == 1 1224a238c70SJohn Marino typedef short mpfr_prec_t; 1234a238c70SJohn Marino typedef unsigned short mpfr_uprec_t; 1244a238c70SJohn Marino #elif _MPFR_PREC_FORMAT == 2 1254a238c70SJohn Marino typedef int mpfr_prec_t; 1264a238c70SJohn Marino typedef unsigned int mpfr_uprec_t; 1274a238c70SJohn Marino #elif _MPFR_PREC_FORMAT == 3 1284a238c70SJohn Marino typedef long mpfr_prec_t; 1294a238c70SJohn Marino typedef unsigned long mpfr_uprec_t; 1304a238c70SJohn Marino #else 1314a238c70SJohn Marino # error "Invalid MPFR Prec format" 1324a238c70SJohn Marino #endif 1334a238c70SJohn Marino 1344a238c70SJohn Marino /* Definition of precision limits without needing <limits.h> */ 1354a238c70SJohn Marino /* Note: the casts allows the expression to yield the wanted behavior 1364a238c70SJohn Marino for _MPFR_PREC_FORMAT == 1 (due to integer promotion rules). */ 1374a238c70SJohn Marino #define MPFR_PREC_MIN 2 1384a238c70SJohn Marino #define MPFR_PREC_MAX ((mpfr_prec_t)((mpfr_uprec_t)(~(mpfr_uprec_t)0)>>1)) 1394a238c70SJohn Marino 1404a238c70SJohn Marino /* Definition of sign */ 1414a238c70SJohn Marino typedef int mpfr_sign_t; 1424a238c70SJohn Marino 1434a238c70SJohn Marino /* Definition of the exponent. _MPFR_EXP_FORMAT must be large enough 1444a238c70SJohn Marino so that mpfr_exp_t has at least 32 bits. */ 1454a238c70SJohn Marino #if _MPFR_EXP_FORMAT == 1 1464a238c70SJohn Marino typedef short mpfr_exp_t; 1474a238c70SJohn Marino typedef unsigned short mpfr_uexp_t; 1484a238c70SJohn Marino #elif _MPFR_EXP_FORMAT == 2 1494a238c70SJohn Marino typedef int mpfr_exp_t; 1504a238c70SJohn Marino typedef unsigned int mpfr_uexp_t; 1514a238c70SJohn Marino #elif _MPFR_EXP_FORMAT == 3 1524a238c70SJohn Marino typedef long mpfr_exp_t; 1534a238c70SJohn Marino typedef unsigned long mpfr_uexp_t; 1544a238c70SJohn Marino #elif _MPFR_EXP_FORMAT == 4 1554a238c70SJohn Marino /* Note: in this case, intmax_t and uintmax_t must be defined before 1564a238c70SJohn Marino the inclusion of mpfr.h (we do not include <stdint.h> here because 1574a238c70SJohn Marino of some non-ISO C99 implementations that support these types). */ 1584a238c70SJohn Marino typedef intmax_t mpfr_exp_t; 1594a238c70SJohn Marino typedef uintmax_t mpfr_uexp_t; 1604a238c70SJohn Marino #else 1614a238c70SJohn Marino # error "Invalid MPFR Exp format" 1624a238c70SJohn Marino #endif 1634a238c70SJohn Marino 1644a238c70SJohn Marino /* Definition of the standard exponent limits */ 1654a238c70SJohn Marino #define MPFR_EMAX_DEFAULT ((mpfr_exp_t) (((mpfr_ulong) 1 << 30) - 1)) 1664a238c70SJohn Marino #define MPFR_EMIN_DEFAULT (-(MPFR_EMAX_DEFAULT)) 1674a238c70SJohn Marino 1684a238c70SJohn Marino /* DON'T USE THIS! (For MPFR-public macros only, see below.) 1694a238c70SJohn Marino The mpfr_sgn macro uses the fact that __MPFR_EXP_NAN and __MPFR_EXP_ZERO 1704a238c70SJohn Marino are the smallest values. */ 1714a238c70SJohn Marino #define __MPFR_EXP_MAX ((mpfr_exp_t) (((mpfr_uexp_t) -1) >> 1)) 1724a238c70SJohn Marino #define __MPFR_EXP_NAN (1 - __MPFR_EXP_MAX) 1734a238c70SJohn Marino #define __MPFR_EXP_ZERO (0 - __MPFR_EXP_MAX) 1744a238c70SJohn Marino #define __MPFR_EXP_INF (2 - __MPFR_EXP_MAX) 1754a238c70SJohn Marino 1764a238c70SJohn Marino /* Definition of the main structure */ 1774a238c70SJohn Marino typedef struct { 1784a238c70SJohn Marino mpfr_prec_t _mpfr_prec; 1794a238c70SJohn Marino mpfr_sign_t _mpfr_sign; 1804a238c70SJohn Marino mpfr_exp_t _mpfr_exp; 1814a238c70SJohn Marino mp_limb_t *_mpfr_d; 1824a238c70SJohn Marino } __mpfr_struct; 1834a238c70SJohn Marino 1844a238c70SJohn Marino /* Compatibility with previous types of MPFR */ 1854a238c70SJohn Marino #ifndef mp_rnd_t 1864a238c70SJohn Marino # define mp_rnd_t mpfr_rnd_t 1874a238c70SJohn Marino #endif 1884a238c70SJohn Marino #ifndef mp_prec_t 1894a238c70SJohn Marino # define mp_prec_t mpfr_prec_t 1904a238c70SJohn Marino #endif 1914a238c70SJohn Marino 1924a238c70SJohn Marino /* 1934a238c70SJohn Marino The represented number is 1944a238c70SJohn Marino _sign*(_d[k-1]/B+_d[k-2]/B^2+...+_d[0]/B^k)*2^_exp 1954a238c70SJohn Marino where k=ceil(_mp_prec/GMP_NUMB_BITS) and B=2^GMP_NUMB_BITS. 1964a238c70SJohn Marino 1974a238c70SJohn Marino For the msb (most significant bit) normalized representation, we must have 1984a238c70SJohn Marino _d[k-1]>=B/2, unless the number is singular. 1994a238c70SJohn Marino 2004a238c70SJohn Marino We must also have the last k*GMP_NUMB_BITS-_prec bits set to zero. 2014a238c70SJohn Marino */ 2024a238c70SJohn Marino 2034a238c70SJohn Marino typedef __mpfr_struct mpfr_t[1]; 2044a238c70SJohn Marino typedef __mpfr_struct *mpfr_ptr; 2054a238c70SJohn Marino typedef __gmp_const __mpfr_struct *mpfr_srcptr; 2064a238c70SJohn Marino 2074a238c70SJohn Marino /* For those who need a direct and fast access to the sign field. 2084a238c70SJohn Marino However it is not in the API, thus use it at your own risk: it might 2094a238c70SJohn Marino not be supported, or change name, in further versions! 2104a238c70SJohn Marino Unfortunately, it must be defined here (instead of MPFR's internal 2114a238c70SJohn Marino header file mpfr-impl.h) because it is used by some macros below. 2124a238c70SJohn Marino */ 2134a238c70SJohn Marino #define MPFR_SIGN(x) ((x)->_mpfr_sign) 2144a238c70SJohn Marino 2154a238c70SJohn Marino /* Stack interface */ 2164a238c70SJohn Marino typedef enum { 2174a238c70SJohn Marino MPFR_NAN_KIND = 0, 2184a238c70SJohn Marino MPFR_INF_KIND = 1, MPFR_ZERO_KIND = 2, MPFR_REGULAR_KIND = 3 2194a238c70SJohn Marino } mpfr_kind_t; 2204a238c70SJohn Marino 2214a238c70SJohn Marino /* GMP defines: 2224a238c70SJohn Marino + size_t: Standard size_t 2234a238c70SJohn Marino + __GMP_ATTRIBUTE_PURE Attribute for math functions. 2244a238c70SJohn Marino + __GMP_NOTHROW For C++: can't throw . 2254a238c70SJohn Marino + __GMP_EXTERN_INLINE Attribute for inline function. 2264a238c70SJohn Marino * __gmp_const const (Supports for K&R compiler only for mpfr.h). 2274a238c70SJohn Marino + __GMP_DECLSPEC_EXPORT compiling to go into a DLL 2284a238c70SJohn Marino + __GMP_DECLSPEC_IMPORT compiling to go into a application 2294a238c70SJohn Marino */ 2304a238c70SJohn Marino /* Extra MPFR defines */ 2314a238c70SJohn Marino #define __MPFR_SENTINEL_ATTR 2324a238c70SJohn Marino #if defined (__GNUC__) 2334a238c70SJohn Marino # if __GNUC__ >= 4 2344a238c70SJohn Marino # undef __MPFR_SENTINEL_ATTR 2354a238c70SJohn Marino # define __MPFR_SENTINEL_ATTR __attribute__ ((sentinel)) 2364a238c70SJohn Marino # endif 2374a238c70SJohn Marino #endif 2384a238c70SJohn Marino 2394a238c70SJohn Marino /* Prototypes: Support of K&R compiler */ 2404a238c70SJohn Marino #if defined (__GMP_PROTO) 2414a238c70SJohn Marino # define _MPFR_PROTO __GMP_PROTO 2424a238c70SJohn Marino #elif defined (__STDC__) || defined (__cplusplus) 2434a238c70SJohn Marino # define _MPFR_PROTO(x) x 2444a238c70SJohn Marino #else 2454a238c70SJohn Marino # define _MPFR_PROTO(x) () 2464a238c70SJohn Marino #endif 2474a238c70SJohn Marino /* Support for WINDOWS Dll: 2484a238c70SJohn Marino Check if we are inside a MPFR build, and if so export the functions. 2494a238c70SJohn Marino Otherwise does the same thing as GMP */ 2504a238c70SJohn Marino #if defined(__MPFR_WITHIN_MPFR) && __GMP_LIBGMP_DLL 2514a238c70SJohn Marino # define __MPFR_DECLSPEC __GMP_DECLSPEC_EXPORT 2524a238c70SJohn Marino #else 2534a238c70SJohn Marino # define __MPFR_DECLSPEC __GMP_DECLSPEC 2544a238c70SJohn Marino #endif 2554a238c70SJohn Marino 2564a238c70SJohn Marino /* Use MPFR_DEPRECATED to mark MPFR functions, types or variables as 2574a238c70SJohn Marino deprecated. Code inspired by Apache Subversion's svn_types.h file. */ 2584a238c70SJohn Marino #if defined(__GNUC__) && \ 2594a238c70SJohn Marino (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) 2604a238c70SJohn Marino # define MPFR_DEPRECATED __attribute__ ((deprecated)) 2614a238c70SJohn Marino #elif defined(_MSC_VER) && _MSC_VER >= 1300 2624a238c70SJohn Marino # define MPFR_DEPRECATED __declspec(deprecated) 2634a238c70SJohn Marino #else 2644a238c70SJohn Marino # define MPFR_DEPRECATED 2654a238c70SJohn Marino #endif 2664a238c70SJohn Marino 2674a238c70SJohn Marino /* Note: In order to be declared, some functions need a specific 2684a238c70SJohn Marino system header to be included *before* "mpfr.h". If the user 2694a238c70SJohn Marino forgets to include the header, the MPFR function prototype in 2704a238c70SJohn Marino the user object file is not correct. To avoid wrong results, 2714a238c70SJohn Marino we raise a linker error in that case by changing their internal 2724a238c70SJohn Marino name in the library (prefixed by __gmpfr instead of mpfr). See 2734a238c70SJohn Marino the lines of the form "#define mpfr_xxx __gmpfr_xxx" below. */ 2744a238c70SJohn Marino 2754a238c70SJohn Marino #if defined (__cplusplus) 2764a238c70SJohn Marino extern "C" { 2774a238c70SJohn Marino #endif 2784a238c70SJohn Marino 2794a238c70SJohn Marino __MPFR_DECLSPEC __gmp_const char * mpfr_get_version _MPFR_PROTO ((void)); 2804a238c70SJohn Marino __MPFR_DECLSPEC __gmp_const char * mpfr_get_patches _MPFR_PROTO ((void)); 2814a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_buildopt_tls_p _MPFR_PROTO ((void)); 2824a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_buildopt_decimal_p _MPFR_PROTO ((void)); 2834a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_buildopt_gmpinternals_p _MPFR_PROTO ((void)); 2844a238c70SJohn Marino __MPFR_DECLSPEC __gmp_const char * mpfr_buildopt_tune_case _MPFR_PROTO ((void)); 2854a238c70SJohn Marino 2864a238c70SJohn Marino __MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin _MPFR_PROTO ((void)); 2874a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_set_emin _MPFR_PROTO ((mpfr_exp_t)); 2884a238c70SJohn Marino __MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin_min _MPFR_PROTO ((void)); 2894a238c70SJohn Marino __MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin_max _MPFR_PROTO ((void)); 2904a238c70SJohn Marino __MPFR_DECLSPEC mpfr_exp_t mpfr_get_emax _MPFR_PROTO ((void)); 2914a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_set_emax _MPFR_PROTO ((mpfr_exp_t)); 2924a238c70SJohn Marino __MPFR_DECLSPEC mpfr_exp_t mpfr_get_emax_min _MPFR_PROTO ((void)); 2934a238c70SJohn Marino __MPFR_DECLSPEC mpfr_exp_t mpfr_get_emax_max _MPFR_PROTO ((void)); 2944a238c70SJohn Marino 2954a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_default_rounding_mode _MPFR_PROTO((mpfr_rnd_t)); 2964a238c70SJohn Marino __MPFR_DECLSPEC mpfr_rnd_t mpfr_get_default_rounding_mode _MPFR_PROTO((void)); 2974a238c70SJohn Marino __MPFR_DECLSPEC __gmp_const char * 2984a238c70SJohn Marino mpfr_print_rnd_mode _MPFR_PROTO((mpfr_rnd_t)); 2994a238c70SJohn Marino 3004a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_clear_flags _MPFR_PROTO ((void)); 3014a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_clear_underflow _MPFR_PROTO ((void)); 3024a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_clear_overflow _MPFR_PROTO ((void)); 3034a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_clear_divby0 _MPFR_PROTO ((void)); 3044a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_clear_nanflag _MPFR_PROTO ((void)); 3054a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_clear_inexflag _MPFR_PROTO ((void)); 3064a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_clear_erangeflag _MPFR_PROTO ((void)); 3074a238c70SJohn Marino 3084a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_underflow _MPFR_PROTO ((void)); 3094a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_overflow _MPFR_PROTO ((void)); 3104a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_divby0 _MPFR_PROTO ((void)); 3114a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_nanflag _MPFR_PROTO ((void)); 3124a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_inexflag _MPFR_PROTO ((void)); 3134a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_erangeflag _MPFR_PROTO ((void)); 3144a238c70SJohn Marino 3154a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_underflow_p _MPFR_PROTO ((void)); 3164a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_overflow_p _MPFR_PROTO ((void)); 3174a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_divby0_p _MPFR_PROTO ((void)); 3184a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_nanflag_p _MPFR_PROTO ((void)); 3194a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_inexflag_p _MPFR_PROTO ((void)); 3204a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_erangeflag_p _MPFR_PROTO ((void)); 3214a238c70SJohn Marino 3224a238c70SJohn Marino __MPFR_DECLSPEC int 3234a238c70SJohn Marino mpfr_check_range _MPFR_PROTO ((mpfr_ptr, int, mpfr_rnd_t)); 3244a238c70SJohn Marino 3254a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_init2 _MPFR_PROTO ((mpfr_ptr, mpfr_prec_t)); 3264a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_init _MPFR_PROTO ((mpfr_ptr)); 3274a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_clear _MPFR_PROTO ((mpfr_ptr)); 3284a238c70SJohn Marino 3294a238c70SJohn Marino __MPFR_DECLSPEC void 3304a238c70SJohn Marino mpfr_inits2 _MPFR_PROTO ((mpfr_prec_t, mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR; 3314a238c70SJohn Marino __MPFR_DECLSPEC void 3324a238c70SJohn Marino mpfr_inits _MPFR_PROTO ((mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR; 3334a238c70SJohn Marino __MPFR_DECLSPEC void 3344a238c70SJohn Marino mpfr_clears _MPFR_PROTO ((mpfr_ptr, ...)) __MPFR_SENTINEL_ATTR; 3354a238c70SJohn Marino 3364a238c70SJohn Marino __MPFR_DECLSPEC int 3374a238c70SJohn Marino mpfr_prec_round _MPFR_PROTO ((mpfr_ptr, mpfr_prec_t, mpfr_rnd_t)); 3384a238c70SJohn Marino __MPFR_DECLSPEC int 3394a238c70SJohn Marino mpfr_can_round _MPFR_PROTO ((mpfr_srcptr, mpfr_exp_t, mpfr_rnd_t, mpfr_rnd_t, 3404a238c70SJohn Marino mpfr_prec_t)); 3414a238c70SJohn Marino __MPFR_DECLSPEC mpfr_prec_t mpfr_min_prec _MPFR_PROTO ((mpfr_srcptr)); 3424a238c70SJohn Marino 3434a238c70SJohn Marino __MPFR_DECLSPEC mpfr_exp_t mpfr_get_exp _MPFR_PROTO ((mpfr_srcptr)); 3444a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_set_exp _MPFR_PROTO ((mpfr_ptr, mpfr_exp_t)); 3454a238c70SJohn Marino __MPFR_DECLSPEC mpfr_prec_t mpfr_get_prec _MPFR_PROTO((mpfr_srcptr)); 3464a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_prec _MPFR_PROTO((mpfr_ptr, mpfr_prec_t)); 3474a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_prec_raw _MPFR_PROTO((mpfr_ptr, mpfr_prec_t)); 3484a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_default_prec _MPFR_PROTO((mpfr_prec_t)); 3494a238c70SJohn Marino __MPFR_DECLSPEC mpfr_prec_t mpfr_get_default_prec _MPFR_PROTO((void)); 3504a238c70SJohn Marino 3514a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_set_d _MPFR_PROTO ((mpfr_ptr, double, mpfr_rnd_t)); 3524a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_set_flt _MPFR_PROTO ((mpfr_ptr, float, mpfr_rnd_t)); 3534a238c70SJohn Marino #ifdef MPFR_WANT_DECIMAL_FLOATS 3544a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_set_decimal64 _MPFR_PROTO ((mpfr_ptr, _Decimal64, 3554a238c70SJohn Marino mpfr_rnd_t)); 3564a238c70SJohn Marino #endif 3574a238c70SJohn Marino __MPFR_DECLSPEC int 3584a238c70SJohn Marino mpfr_set_ld _MPFR_PROTO ((mpfr_ptr, long double, mpfr_rnd_t)); 3594a238c70SJohn Marino __MPFR_DECLSPEC int 3604a238c70SJohn Marino mpfr_set_z _MPFR_PROTO ((mpfr_ptr, mpz_srcptr, mpfr_rnd_t)); 3614a238c70SJohn Marino __MPFR_DECLSPEC int 3624a238c70SJohn Marino mpfr_set_z_2exp _MPFR_PROTO ((mpfr_ptr, mpz_srcptr, mpfr_exp_t, mpfr_rnd_t)); 3634a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_nan _MPFR_PROTO ((mpfr_ptr)); 3644a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_inf _MPFR_PROTO ((mpfr_ptr, int)); 3654a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_set_zero _MPFR_PROTO ((mpfr_ptr, int)); 3664a238c70SJohn Marino __MPFR_DECLSPEC int 3674a238c70SJohn Marino mpfr_set_f _MPFR_PROTO ((mpfr_ptr, mpf_srcptr, mpfr_rnd_t)); 3684a238c70SJohn Marino __MPFR_DECLSPEC int 3694a238c70SJohn Marino mpfr_get_f _MPFR_PROTO ((mpf_ptr, mpfr_srcptr, mpfr_rnd_t)); 3704a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_set_si _MPFR_PROTO ((mpfr_ptr, long, mpfr_rnd_t)); 3714a238c70SJohn Marino __MPFR_DECLSPEC int 3724a238c70SJohn Marino mpfr_set_ui _MPFR_PROTO ((mpfr_ptr, unsigned long, mpfr_rnd_t)); 3734a238c70SJohn Marino __MPFR_DECLSPEC int 3744a238c70SJohn Marino mpfr_set_si_2exp _MPFR_PROTO ((mpfr_ptr, long, mpfr_exp_t, mpfr_rnd_t)); 3754a238c70SJohn Marino __MPFR_DECLSPEC int 3764a238c70SJohn Marino mpfr_set_ui_2exp _MPFR_PROTO ((mpfr_ptr,unsigned long,mpfr_exp_t,mpfr_rnd_t)); 3774a238c70SJohn Marino __MPFR_DECLSPEC int 3784a238c70SJohn Marino mpfr_set_q _MPFR_PROTO ((mpfr_ptr, mpq_srcptr, mpfr_rnd_t)); 3794a238c70SJohn Marino __MPFR_DECLSPEC int 3804a238c70SJohn Marino mpfr_set_str _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, int, mpfr_rnd_t)); 3814a238c70SJohn Marino __MPFR_DECLSPEC int 3824a238c70SJohn Marino mpfr_init_set_str _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, int, 3834a238c70SJohn Marino mpfr_rnd_t)); 3844a238c70SJohn Marino __MPFR_DECLSPEC int 3854a238c70SJohn Marino mpfr_set4 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t, int)); 3864a238c70SJohn Marino __MPFR_DECLSPEC int 3874a238c70SJohn Marino mpfr_abs _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t)); 3884a238c70SJohn Marino __MPFR_DECLSPEC int 3894a238c70SJohn Marino mpfr_set _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t)); 3904a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_neg _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t)); 3914a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_signbit _MPFR_PROTO ((mpfr_srcptr)); 3924a238c70SJohn Marino __MPFR_DECLSPEC int 3934a238c70SJohn Marino mpfr_setsign _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, int, mpfr_rnd_t)); 3944a238c70SJohn Marino __MPFR_DECLSPEC int 3954a238c70SJohn Marino mpfr_copysign _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t)); 3964a238c70SJohn Marino 3974a238c70SJohn Marino __MPFR_DECLSPEC mpfr_exp_t mpfr_get_z_2exp _MPFR_PROTO ((mpz_ptr, mpfr_srcptr)); 3984a238c70SJohn Marino __MPFR_DECLSPEC float mpfr_get_flt _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t)); 3994a238c70SJohn Marino __MPFR_DECLSPEC double mpfr_get_d _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t)); 4004a238c70SJohn Marino #ifdef MPFR_WANT_DECIMAL_FLOATS 4014a238c70SJohn Marino __MPFR_DECLSPEC _Decimal64 mpfr_get_decimal64 _MPFR_PROTO ((mpfr_srcptr, 4024a238c70SJohn Marino mpfr_rnd_t)); 4034a238c70SJohn Marino #endif 4044a238c70SJohn Marino __MPFR_DECLSPEC long double mpfr_get_ld _MPFR_PROTO ((mpfr_srcptr, 4054a238c70SJohn Marino mpfr_rnd_t)); 4064a238c70SJohn Marino __MPFR_DECLSPEC double mpfr_get_d1 _MPFR_PROTO ((mpfr_srcptr)); 4074a238c70SJohn Marino __MPFR_DECLSPEC double mpfr_get_d_2exp _MPFR_PROTO ((long*, mpfr_srcptr, 4084a238c70SJohn Marino mpfr_rnd_t)); 4094a238c70SJohn Marino __MPFR_DECLSPEC long double mpfr_get_ld_2exp _MPFR_PROTO ((long*, mpfr_srcptr, 4104a238c70SJohn Marino mpfr_rnd_t)); 4114a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_frexp _MPFR_PROTO ((mpfr_exp_t*, mpfr_ptr, 4124a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4134a238c70SJohn Marino __MPFR_DECLSPEC long mpfr_get_si _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t)); 4144a238c70SJohn Marino __MPFR_DECLSPEC unsigned long mpfr_get_ui _MPFR_PROTO ((mpfr_srcptr, 4154a238c70SJohn Marino mpfr_rnd_t)); 4164a238c70SJohn Marino __MPFR_DECLSPEC char*mpfr_get_str _MPFR_PROTO ((char*, mpfr_exp_t*, int, size_t, 4174a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4184a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_get_z _MPFR_PROTO ((mpz_ptr z, mpfr_srcptr f, 4194a238c70SJohn Marino mpfr_rnd_t)); 4204a238c70SJohn Marino 4214a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_free_str _MPFR_PROTO ((char *)); 4224a238c70SJohn Marino 4234a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_urandom _MPFR_PROTO ((mpfr_ptr, gmp_randstate_t, 4244a238c70SJohn Marino mpfr_rnd_t)); 4254a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_grandom _MPFR_PROTO ((mpfr_ptr, mpfr_ptr, gmp_randstate_t, 4264a238c70SJohn Marino mpfr_rnd_t)); 4274a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_urandomb _MPFR_PROTO ((mpfr_ptr, gmp_randstate_t)); 4284a238c70SJohn Marino 4294a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_nextabove _MPFR_PROTO ((mpfr_ptr)); 4304a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_nextbelow _MPFR_PROTO ((mpfr_ptr)); 4314a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_nexttoward _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr)); 4324a238c70SJohn Marino 4334a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_printf _MPFR_PROTO ((__gmp_const char*, ...)); 4344a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_asprintf _MPFR_PROTO ((char**, __gmp_const char*, 4354a238c70SJohn Marino ...)); 4364a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sprintf _MPFR_PROTO ((char*, __gmp_const char*, 4374a238c70SJohn Marino ...)); 4384a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_snprintf _MPFR_PROTO ((char*, size_t, 4394a238c70SJohn Marino __gmp_const char*, ...)); 4404a238c70SJohn Marino 4414a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_pow _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4424a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4434a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_pow_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4444a238c70SJohn Marino long int, mpfr_rnd_t)); 4454a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_pow_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4464a238c70SJohn Marino unsigned long int, mpfr_rnd_t)); 4474a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_ui_pow_ui _MPFR_PROTO ((mpfr_ptr, unsigned long int, 4484a238c70SJohn Marino unsigned long int, mpfr_rnd_t)); 4494a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_ui_pow _MPFR_PROTO ((mpfr_ptr, unsigned long int, 4504a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4514a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_pow_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4524a238c70SJohn Marino mpz_srcptr, mpfr_rnd_t)); 4534a238c70SJohn Marino 4544a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sqrt _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4554a238c70SJohn Marino mpfr_rnd_t)); 4564a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sqrt_ui _MPFR_PROTO ((mpfr_ptr, unsigned long, 4574a238c70SJohn Marino mpfr_rnd_t)); 4584a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_rec_sqrt _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4594a238c70SJohn Marino mpfr_rnd_t)); 4604a238c70SJohn Marino 4614a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_add _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4624a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4634a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sub _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4644a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4654a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_mul _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4664a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4674a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_div _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4684a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4694a238c70SJohn Marino 4704a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_add_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4714a238c70SJohn Marino unsigned long, mpfr_rnd_t)); 4724a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sub_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4734a238c70SJohn Marino unsigned long, mpfr_rnd_t)); 4744a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_ui_sub _MPFR_PROTO ((mpfr_ptr, unsigned long, 4754a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4764a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_mul_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4774a238c70SJohn Marino unsigned long, mpfr_rnd_t)); 4784a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_div_ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4794a238c70SJohn Marino unsigned long, mpfr_rnd_t)); 4804a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_ui_div _MPFR_PROTO ((mpfr_ptr, unsigned long, 4814a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4824a238c70SJohn Marino 4834a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_add_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4844a238c70SJohn Marino long int, mpfr_rnd_t)); 4854a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sub_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4864a238c70SJohn Marino long int, mpfr_rnd_t)); 4874a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_si_sub _MPFR_PROTO ((mpfr_ptr, long int, 4884a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4894a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_mul_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4904a238c70SJohn Marino long int, mpfr_rnd_t)); 4914a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_div_si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4924a238c70SJohn Marino long int, mpfr_rnd_t)); 4934a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_si_div _MPFR_PROTO ((mpfr_ptr, long int, 4944a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 4954a238c70SJohn Marino 4964a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_add_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4974a238c70SJohn Marino double, mpfr_rnd_t)); 4984a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sub_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 4994a238c70SJohn Marino double, mpfr_rnd_t)); 5004a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_d_sub _MPFR_PROTO ((mpfr_ptr, double, 5014a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 5024a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_mul_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5034a238c70SJohn Marino double, mpfr_rnd_t)); 5044a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_div_d _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5054a238c70SJohn Marino double, mpfr_rnd_t)); 5064a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_d_div _MPFR_PROTO ((mpfr_ptr, double, 5074a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 5084a238c70SJohn Marino 5094a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sqr _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 5104a238c70SJohn Marino 5114a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_const_pi _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t)); 5124a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_const_log2 _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t)); 5134a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_const_euler _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t)); 5144a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_const_catalan _MPFR_PROTO ((mpfr_ptr, mpfr_rnd_t)); 5154a238c70SJohn Marino 5164a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_agm _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, 5174a238c70SJohn Marino mpfr_rnd_t)); 5184a238c70SJohn Marino 5194a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_log _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 5204a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_log2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 5214a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_log10 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5224a238c70SJohn Marino mpfr_rnd_t)); 5234a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_log1p _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5244a238c70SJohn Marino mpfr_rnd_t)); 5254a238c70SJohn Marino 5264a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 5274a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_exp2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 5284a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_exp10 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5294a238c70SJohn Marino mpfr_rnd_t)); 5304a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_expm1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5314a238c70SJohn Marino mpfr_rnd_t)); 5324a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_eint _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 5334a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_li2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 5344a238c70SJohn Marino 5354a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr)); 5364a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp3 _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr, int)); 5374a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp_d _MPFR_PROTO ((mpfr_srcptr, double)); 5384a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp_ld _MPFR_PROTO ((mpfr_srcptr, long double)); 5394a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmpabs _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr)); 5404a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp_ui _MPFR_PROTO ((mpfr_srcptr, unsigned long)); 5414a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp_si _MPFR_PROTO ((mpfr_srcptr, long)); 5424a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp_ui_2exp _MPFR_PROTO ((mpfr_srcptr, unsigned long, 5434a238c70SJohn Marino mpfr_exp_t)); 5444a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp_si_2exp _MPFR_PROTO ((mpfr_srcptr, long, 5454a238c70SJohn Marino mpfr_exp_t)); 5464a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_reldiff _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5474a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 5484a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_eq _MPFR_PROTO((mpfr_srcptr, mpfr_srcptr, 5494a238c70SJohn Marino unsigned long)); 5504a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sgn _MPFR_PROTO ((mpfr_srcptr)); 5514a238c70SJohn Marino 5524a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_mul_2exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5534a238c70SJohn Marino unsigned long, mpfr_rnd_t)); 5544a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_div_2exp _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5554a238c70SJohn Marino unsigned long, mpfr_rnd_t)); 5564a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_mul_2ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5574a238c70SJohn Marino unsigned long, mpfr_rnd_t)); 5584a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_div_2ui _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5594a238c70SJohn Marino unsigned long, mpfr_rnd_t)); 5604a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_mul_2si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5614a238c70SJohn Marino long, mpfr_rnd_t)); 5624a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_div_2si _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5634a238c70SJohn Marino long, mpfr_rnd_t)); 5644a238c70SJohn Marino 5654a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_rint _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t)); 5664a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_round _MPFR_PROTO((mpfr_ptr, mpfr_srcptr)); 5674a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_trunc _MPFR_PROTO((mpfr_ptr, mpfr_srcptr)); 5684a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_ceil _MPFR_PROTO((mpfr_ptr, mpfr_srcptr)); 5694a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_floor _MPFR_PROTO((mpfr_ptr, mpfr_srcptr)); 5704a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_rint_round _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5714a238c70SJohn Marino mpfr_rnd_t)); 5724a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_rint_trunc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5734a238c70SJohn Marino mpfr_rnd_t)); 5744a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_rint_ceil _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5754a238c70SJohn Marino mpfr_rnd_t)); 5764a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_rint_floor _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5774a238c70SJohn Marino mpfr_rnd_t)); 5784a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_frac _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 5794a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_modf _MPFR_PROTO ((mpfr_ptr, mpfr_ptr, mpfr_srcptr, 5804a238c70SJohn Marino mpfr_rnd_t)); 5814a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_remquo _MPFR_PROTO ((mpfr_ptr, long*, mpfr_srcptr, 5824a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 5834a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_remainder _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5844a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 5854a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fmod _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 5864a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 5874a238c70SJohn Marino 5884a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fits_ulong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t)); 5894a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fits_slong_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t)); 5904a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fits_uint_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t)); 5914a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fits_sint_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t)); 5924a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fits_ushort_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t)); 5934a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fits_sshort_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t)); 5944a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fits_uintmax_p _MPFR_PROTO((mpfr_srcptr,mpfr_rnd_t)); 5954a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fits_intmax_p _MPFR_PROTO((mpfr_srcptr, mpfr_rnd_t)); 5964a238c70SJohn Marino 5974a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_extract _MPFR_PROTO ((mpz_ptr, mpfr_srcptr, 5984a238c70SJohn Marino unsigned int)); 5994a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_swap _MPFR_PROTO ((mpfr_ptr, mpfr_ptr)); 6004a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_dump _MPFR_PROTO ((mpfr_srcptr)); 6014a238c70SJohn Marino 6024a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_nan_p _MPFR_PROTO((mpfr_srcptr)); 6034a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_inf_p _MPFR_PROTO((mpfr_srcptr)); 6044a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_number_p _MPFR_PROTO((mpfr_srcptr)); 6054a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_integer_p _MPFR_PROTO ((mpfr_srcptr)); 6064a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_zero_p _MPFR_PROTO ((mpfr_srcptr)); 6074a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_regular_p _MPFR_PROTO ((mpfr_srcptr)); 6084a238c70SJohn Marino 6094a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_greater_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr)); 6104a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_greaterequal_p _MPFR_PROTO ((mpfr_srcptr, 6114a238c70SJohn Marino mpfr_srcptr)); 6124a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_less_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr)); 6134a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_lessequal_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr)); 6144a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_lessgreater_p _MPFR_PROTO((mpfr_srcptr,mpfr_srcptr)); 6154a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_equal_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr)); 6164a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_unordered_p _MPFR_PROTO ((mpfr_srcptr, mpfr_srcptr)); 6174a238c70SJohn Marino 6184a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_atanh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6194a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_acosh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6204a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_asinh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6214a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cosh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t)); 6224a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sinh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t)); 6234a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_tanh _MPFR_PROTO((mpfr_ptr,mpfr_srcptr, mpfr_rnd_t)); 6244a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sinh_cosh _MPFR_PROTO ((mpfr_ptr, mpfr_ptr, 6254a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 6264a238c70SJohn Marino 6274a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sech _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6284a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_csch _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6294a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_coth _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6304a238c70SJohn Marino 6314a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_acos _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6324a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_asin _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6334a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_atan _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6344a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sin _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6354a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sin_cos _MPFR_PROTO ((mpfr_ptr, mpfr_ptr, 6364a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 6374a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cos _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6384a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_tan _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6394a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_atan2 _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_srcptr, 6404a238c70SJohn Marino mpfr_rnd_t)); 6414a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sec _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6424a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_csc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6434a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cot _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6444a238c70SJohn Marino 6454a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_hypot _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 6464a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 6474a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_erf _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6484a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_erfc _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr,mpfr_rnd_t)); 6494a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cbrt _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6504a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_root _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,unsigned long,mpfr_rnd_t)); 6514a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_gamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6524a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_lngamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6534a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_lgamma _MPFR_PROTO((mpfr_ptr,int*,mpfr_srcptr,mpfr_rnd_t)); 6544a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_digamma _MPFR_PROTO((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6554a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_zeta _MPFR_PROTO ((mpfr_ptr,mpfr_srcptr,mpfr_rnd_t)); 6564a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_zeta_ui _MPFR_PROTO ((mpfr_ptr,unsigned long,mpfr_rnd_t)); 6574a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fac_ui _MPFR_PROTO ((mpfr_ptr, unsigned long int, 6584a238c70SJohn Marino mpfr_rnd_t)); 6594a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_j0 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t)); 6604a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_j1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t)); 6614a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_jn _MPFR_PROTO ((mpfr_ptr, long, mpfr_srcptr, 6624a238c70SJohn Marino mpfr_rnd_t)); 6634a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_y0 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t)); 6644a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_y1 _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t)); 6654a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_yn _MPFR_PROTO ((mpfr_ptr, long, mpfr_srcptr, 6664a238c70SJohn Marino mpfr_rnd_t)); 6674a238c70SJohn Marino 6684a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_ai _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_rnd_t)); 6694a238c70SJohn Marino 6704a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_min _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, 6714a238c70SJohn Marino mpfr_rnd_t)); 6724a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_max _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, 6734a238c70SJohn Marino mpfr_rnd_t)); 6744a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_dim _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, 6754a238c70SJohn Marino mpfr_rnd_t)); 6764a238c70SJohn Marino 6774a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_mul_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 6784a238c70SJohn Marino mpz_srcptr, mpfr_rnd_t)); 6794a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_div_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 6804a238c70SJohn Marino mpz_srcptr, mpfr_rnd_t)); 6814a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_add_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 6824a238c70SJohn Marino mpz_srcptr, mpfr_rnd_t)); 6834a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sub_z _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 6844a238c70SJohn Marino mpz_srcptr, mpfr_rnd_t)); 6854a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_z_sub _MPFR_PROTO ((mpfr_ptr, mpz_srcptr, 6864a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 6874a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp_z _MPFR_PROTO ((mpfr_srcptr, mpz_srcptr)); 6884a238c70SJohn Marino 6894a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_mul_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 6904a238c70SJohn Marino mpq_srcptr, mpfr_rnd_t)); 6914a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_div_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 6924a238c70SJohn Marino mpq_srcptr, mpfr_rnd_t)); 6934a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_add_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 6944a238c70SJohn Marino mpq_srcptr, mpfr_rnd_t)); 6954a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sub_q _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, 6964a238c70SJohn Marino mpq_srcptr, mpfr_rnd_t)); 6974a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp_q _MPFR_PROTO ((mpfr_srcptr, mpq_srcptr)); 6984a238c70SJohn Marino 6994a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_cmp_f _MPFR_PROTO ((mpfr_srcptr, mpf_srcptr)); 7004a238c70SJohn Marino 7014a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fma _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, 7024a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 7034a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fms _MPFR_PROTO ((mpfr_ptr, mpfr_srcptr, mpfr_srcptr, 7044a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 7054a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_sum _MPFR_PROTO ((mpfr_ptr, mpfr_ptr *__gmp_const, 7064a238c70SJohn Marino unsigned long, mpfr_rnd_t)); 7074a238c70SJohn Marino 7084a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_free_cache _MPFR_PROTO ((void)); 7094a238c70SJohn Marino 7104a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_subnormalize _MPFR_PROTO ((mpfr_ptr, int, 7114a238c70SJohn Marino mpfr_rnd_t)); 7124a238c70SJohn Marino 7134a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_strtofr _MPFR_PROTO ((mpfr_ptr, __gmp_const char *, 7144a238c70SJohn Marino char **, int, mpfr_rnd_t)); 7154a238c70SJohn Marino 7164a238c70SJohn Marino __MPFR_DECLSPEC size_t mpfr_custom_get_size _MPFR_PROTO ((mpfr_prec_t)); 7174a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_custom_init _MPFR_PROTO ((void *, mpfr_prec_t)); 7184a238c70SJohn Marino __MPFR_DECLSPEC void * mpfr_custom_get_significand _MPFR_PROTO ((mpfr_srcptr)); 7194a238c70SJohn Marino __MPFR_DECLSPEC mpfr_exp_t mpfr_custom_get_exp _MPFR_PROTO ((mpfr_srcptr)); 7204a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_custom_move _MPFR_PROTO ((mpfr_ptr, void *)); 7214a238c70SJohn Marino __MPFR_DECLSPEC void mpfr_custom_init_set _MPFR_PROTO ((mpfr_ptr, int, 7224a238c70SJohn Marino mpfr_exp_t, mpfr_prec_t, void *)); 7234a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_custom_get_kind _MPFR_PROTO ((mpfr_srcptr)); 7244a238c70SJohn Marino 7254a238c70SJohn Marino #if defined (__cplusplus) 7264a238c70SJohn Marino } 7274a238c70SJohn Marino #endif 7284a238c70SJohn Marino 7294a238c70SJohn Marino /* Define MPFR_USE_EXTENSION to avoid "gcc -pedantic" warnings. */ 7304a238c70SJohn Marino #ifndef MPFR_EXTENSION 7314a238c70SJohn Marino # if defined(MPFR_USE_EXTENSION) 7324a238c70SJohn Marino # define MPFR_EXTENSION __extension__ 7334a238c70SJohn Marino # else 7344a238c70SJohn Marino # define MPFR_EXTENSION 7354a238c70SJohn Marino # endif 7364a238c70SJohn Marino #endif 7374a238c70SJohn Marino 7384a238c70SJohn Marino /* Warning! This macro doesn't work with K&R C (e.g., compare the "gcc -E" 7394a238c70SJohn Marino output with and without -traditional) and shouldn't be used internally. 7404a238c70SJohn Marino For public use only, but see the MPFR manual. */ 7414a238c70SJohn Marino #define MPFR_DECL_INIT(_x, _p) \ 7424a238c70SJohn Marino MPFR_EXTENSION mp_limb_t __gmpfr_local_tab_##_x[((_p)-1)/GMP_NUMB_BITS+1]; \ 7434a238c70SJohn Marino MPFR_EXTENSION mpfr_t _x = {{(_p),1,__MPFR_EXP_NAN,__gmpfr_local_tab_##_x}} 7444a238c70SJohn Marino 7454a238c70SJohn Marino /* Fast access macros to replace function interface. 7464a238c70SJohn Marino If the USER don't want to use the macro interface, let him make happy 7474a238c70SJohn Marino even if it produces faster and smaller code. */ 7484a238c70SJohn Marino #ifndef MPFR_USE_NO_MACRO 7494a238c70SJohn Marino 7504a238c70SJohn Marino /* Inlining theses functions is both faster and smaller */ 7514a238c70SJohn Marino #define mpfr_nan_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_NAN) 7524a238c70SJohn Marino #define mpfr_inf_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_INF) 7534a238c70SJohn Marino #define mpfr_zero_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_ZERO) 7544a238c70SJohn Marino #define mpfr_regular_p(_x) ((_x)->_mpfr_exp > __MPFR_EXP_INF) 7554a238c70SJohn Marino #define mpfr_sgn(_x) \ 7564a238c70SJohn Marino ((_x)->_mpfr_exp < __MPFR_EXP_INF ? \ 7574a238c70SJohn Marino (mpfr_nan_p (_x) ? mpfr_set_erangeflag () : (mpfr_void) 0), 0 : \ 7584a238c70SJohn Marino MPFR_SIGN (_x)) 7594a238c70SJohn Marino 7604a238c70SJohn Marino /* Prevent them from using as lvalues */ 7614a238c70SJohn Marino #define MPFR_VALUE_OF(x) (0 ? (x) : (x)) 7624a238c70SJohn Marino #define mpfr_get_prec(_x) MPFR_VALUE_OF((_x)->_mpfr_prec) 7634a238c70SJohn Marino #define mpfr_get_exp(_x) MPFR_VALUE_OF((_x)->_mpfr_exp) 7644a238c70SJohn Marino /* Note: if need be, the MPFR_VALUE_OF can be used for other expressions 7654a238c70SJohn Marino (of any type). Thanks to Wojtek Lerch and Tim Rentsch for the idea. */ 7664a238c70SJohn Marino 7674a238c70SJohn Marino #define mpfr_round(a,b) mpfr_rint((a), (b), MPFR_RNDNA) 7684a238c70SJohn Marino #define mpfr_trunc(a,b) mpfr_rint((a), (b), MPFR_RNDZ) 7694a238c70SJohn Marino #define mpfr_ceil(a,b) mpfr_rint((a), (b), MPFR_RNDU) 7704a238c70SJohn Marino #define mpfr_floor(a,b) mpfr_rint((a), (b), MPFR_RNDD) 7714a238c70SJohn Marino 7724a238c70SJohn Marino #define mpfr_cmp_ui(b,i) mpfr_cmp_ui_2exp((b),(i),0) 7734a238c70SJohn Marino #define mpfr_cmp_si(b,i) mpfr_cmp_si_2exp((b),(i),0) 7744a238c70SJohn Marino #define mpfr_set(a,b,r) mpfr_set4(a,b,r,MPFR_SIGN(b)) 7754a238c70SJohn Marino #define mpfr_abs(a,b,r) mpfr_set4(a,b,r,1) 7764a238c70SJohn Marino #define mpfr_copysign(a,b,c,r) mpfr_set4(a,b,r,MPFR_SIGN(c)) 7774a238c70SJohn Marino #define mpfr_setsign(a,b,s,r) mpfr_set4(a,b,r,(s) ? -1 : 1) 7784a238c70SJohn Marino #define mpfr_signbit(x) (MPFR_SIGN(x) < 0) 7794a238c70SJohn Marino #define mpfr_cmp(b, c) mpfr_cmp3(b, c, 1) 7804a238c70SJohn Marino #define mpfr_mul_2exp(y,x,n,r) mpfr_mul_2ui((y),(x),(n),(r)) 7814a238c70SJohn Marino #define mpfr_div_2exp(y,x,n,r) mpfr_div_2ui((y),(x),(n),(r)) 7824a238c70SJohn Marino 7834a238c70SJohn Marino 7844a238c70SJohn Marino /* When using GCC, optimize certain common comparisons and affectations. 7854a238c70SJohn Marino + Remove ICC since it defines __GNUC__ but produces a 7864a238c70SJohn Marino huge number of warnings if you use this code. 7874a238c70SJohn Marino VL: I couldn't reproduce a single warning when enabling these macros 7884a238c70SJohn Marino with icc 10.1 20080212 on Itanium. But with this version, __ICC isn't 7894a238c70SJohn Marino defined (__INTEL_COMPILER is, though), so that these macros are enabled 7904a238c70SJohn Marino anyway. Checking with other ICC versions is needed. Possibly detect 7914a238c70SJohn Marino whether warnings are produced or not with a configure test. 7924a238c70SJohn Marino + Remove C++ too, since it complains too much. */ 7934a238c70SJohn Marino /* Added casts to improve robustness in case of undefined behavior and 7944a238c70SJohn Marino compiler extensions based on UB (in particular -fwrapv). MPFR doesn't 7954a238c70SJohn Marino use such extensions, but these macros will be used by 3rd-party code, 7964a238c70SJohn Marino where such extensions may be required. 7974a238c70SJohn Marino Moreover casts to unsigned long have been added to avoid warnings in 7984a238c70SJohn Marino programs that use MPFR and are compiled with -Wconversion; such casts 7994a238c70SJohn Marino are OK since if X is a constant expression, then (unsigned long) X is 8004a238c70SJohn Marino also a constant expression, so that the optimizations still work. The 8014a238c70SJohn Marino warnings are probably related to the following two bugs: 8024a238c70SJohn Marino http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210 8034a238c70SJohn Marino http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38470 (possibly a variant) 8044a238c70SJohn Marino and the casts could be removed once these bugs are fixed. 8054a238c70SJohn Marino Casts shouldn't be used on the generic calls (to the ..._2exp functions), 8064a238c70SJohn Marino where implicit conversions are performed. Indeed, having at least one 8074a238c70SJohn Marino implicit conversion in the macro allows the compiler to emit diagnostics 8084a238c70SJohn Marino when normally expected, for instance in the following call: 8094a238c70SJohn Marino mpfr_set_ui (x, "foo", MPFR_RNDN); 8104a238c70SJohn Marino If this is not possible (for future macros), one of the tricks described 8114a238c70SJohn Marino on http://groups.google.com/group/comp.std.c/msg/e92abd24bf9eaf7b could 8124a238c70SJohn Marino be used. */ 8134a238c70SJohn Marino #if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus) 8144a238c70SJohn Marino #if (__GNUC__ >= 2) 8154a238c70SJohn Marino #undef mpfr_cmp_ui 8164a238c70SJohn Marino /* We use the fact that mpfr_sgn on NaN sets the erange flag and returns 0. 8174a238c70SJohn Marino But warning! mpfr_sgn is specified as a macro in the API, thus the macro 8184a238c70SJohn Marino mustn't be used if side effects are possible, like here. */ 8194a238c70SJohn Marino #define mpfr_cmp_ui(_f,_u) \ 8204a238c70SJohn Marino (__builtin_constant_p (_u) && (mpfr_ulong) (_u) == 0 ? \ 8214a238c70SJohn Marino (mpfr_sgn) (_f) : \ 8224a238c70SJohn Marino mpfr_cmp_ui_2exp ((_f), (_u), 0)) 8234a238c70SJohn Marino #undef mpfr_cmp_si 8244a238c70SJohn Marino #define mpfr_cmp_si(_f,_s) \ 8254a238c70SJohn Marino (__builtin_constant_p (_s) && (mpfr_long) (_s) >= 0 ? \ 8264a238c70SJohn Marino mpfr_cmp_ui ((_f), (mpfr_ulong) (mpfr_long) (_s)) : \ 8274a238c70SJohn Marino mpfr_cmp_si_2exp ((_f), (_s), 0)) 8284a238c70SJohn Marino #if __GNUC__ > 2 || __GNUC_MINOR__ >= 95 8294a238c70SJohn Marino #undef mpfr_set_ui 8304a238c70SJohn Marino #define mpfr_set_ui(_f,_u,_r) \ 8314a238c70SJohn Marino (__builtin_constant_p (_u) && (mpfr_ulong) (_u) == 0 ? \ 8324a238c70SJohn Marino __extension__ ({ \ 8334a238c70SJohn Marino mpfr_ptr _p = (_f); \ 8344a238c70SJohn Marino _p->_mpfr_sign = 1; \ 8354a238c70SJohn Marino _p->_mpfr_exp = __MPFR_EXP_ZERO; \ 8364a238c70SJohn Marino (mpfr_void) (_r); 0; }) : \ 8374a238c70SJohn Marino mpfr_set_ui_2exp ((_f), (_u), 0, (_r))) 8384a238c70SJohn Marino #endif 8394a238c70SJohn Marino #undef mpfr_set_si 8404a238c70SJohn Marino #define mpfr_set_si(_f,_s,_r) \ 8414a238c70SJohn Marino (__builtin_constant_p (_s) && (mpfr_long) (_s) >= 0 ? \ 8424a238c70SJohn Marino mpfr_set_ui ((_f), (mpfr_ulong) (mpfr_long) (_s), (_r)) : \ 8434a238c70SJohn Marino mpfr_set_si_2exp ((_f), (_s), 0, (_r))) 8444a238c70SJohn Marino #endif 8454a238c70SJohn Marino #endif 8464a238c70SJohn Marino 8474a238c70SJohn Marino /* Macro version of mpfr_stack interface for fast access */ 8484a238c70SJohn Marino #define mpfr_custom_get_size(p) ((mpfr_size_t) \ 8494a238c70SJohn Marino (((p)+GMP_NUMB_BITS-1)/GMP_NUMB_BITS*sizeof (mp_limb_t))) 8504a238c70SJohn Marino #define mpfr_custom_init(m,p) do {} while (0) 8514a238c70SJohn Marino #define mpfr_custom_get_significand(x) ((mpfr_void*)((x)->_mpfr_d)) 8524a238c70SJohn Marino #define mpfr_custom_get_exp(x) ((x)->_mpfr_exp) 8534a238c70SJohn Marino #define mpfr_custom_move(x,m) do { ((x)->_mpfr_d = (mp_limb_t*)(m)); } while (0) 8544a238c70SJohn Marino #define mpfr_custom_init_set(x,k,e,p,m) do { \ 8554a238c70SJohn Marino mpfr_ptr _x = (x); \ 8564a238c70SJohn Marino mpfr_exp_t _e; \ 8574a238c70SJohn Marino mpfr_kind_t _t; \ 8584a238c70SJohn Marino mpfr_int _s, _k; \ 8594a238c70SJohn Marino _k = (k); \ 8604a238c70SJohn Marino if (_k >= 0) { \ 8614a238c70SJohn Marino _t = (mpfr_kind_t) _k; \ 8624a238c70SJohn Marino _s = 1; \ 8634a238c70SJohn Marino } else { \ 8644a238c70SJohn Marino _t = (mpfr_kind_t) -k; \ 8654a238c70SJohn Marino _s = -1; \ 8664a238c70SJohn Marino } \ 8674a238c70SJohn Marino _e = _t == MPFR_REGULAR_KIND ? (e) : \ 8684a238c70SJohn Marino _t == MPFR_NAN_KIND ? __MPFR_EXP_NAN : \ 8694a238c70SJohn Marino _t == MPFR_INF_KIND ? __MPFR_EXP_INF : __MPFR_EXP_ZERO; \ 8704a238c70SJohn Marino _x->_mpfr_prec = (p); \ 8714a238c70SJohn Marino _x->_mpfr_sign = _s; \ 8724a238c70SJohn Marino _x->_mpfr_exp = _e; \ 8734a238c70SJohn Marino _x->_mpfr_d = (mp_limb_t*) (m); \ 8744a238c70SJohn Marino } while (0) 8754a238c70SJohn Marino #define mpfr_custom_get_kind(x) \ 8764a238c70SJohn Marino ( (x)->_mpfr_exp > __MPFR_EXP_INF ? \ 8774a238c70SJohn Marino (mpfr_int) MPFR_REGULAR_KIND * MPFR_SIGN (x) \ 8784a238c70SJohn Marino : (x)->_mpfr_exp == __MPFR_EXP_INF ? \ 8794a238c70SJohn Marino (mpfr_int) MPFR_INF_KIND * MPFR_SIGN (x) \ 8804a238c70SJohn Marino : (x)->_mpfr_exp == __MPFR_EXP_NAN ? (mpfr_int) MPFR_NAN_KIND \ 8814a238c70SJohn Marino : (mpfr_int) MPFR_ZERO_KIND * MPFR_SIGN (x) ) 8824a238c70SJohn Marino 8834a238c70SJohn Marino 8844a238c70SJohn Marino #endif /* MPFR_USE_NO_MACRO */ 8854a238c70SJohn Marino 8864a238c70SJohn Marino /* Theses are defined to be macros */ 8874a238c70SJohn Marino #define mpfr_init_set_si(x, i, rnd) \ 8884a238c70SJohn Marino ( mpfr_init(x), mpfr_set_si((x), (i), (rnd)) ) 8894a238c70SJohn Marino #define mpfr_init_set_ui(x, i, rnd) \ 8904a238c70SJohn Marino ( mpfr_init(x), mpfr_set_ui((x), (i), (rnd)) ) 8914a238c70SJohn Marino #define mpfr_init_set_d(x, d, rnd) \ 8924a238c70SJohn Marino ( mpfr_init(x), mpfr_set_d((x), (d), (rnd)) ) 8934a238c70SJohn Marino #define mpfr_init_set_ld(x, d, rnd) \ 8944a238c70SJohn Marino ( mpfr_init(x), mpfr_set_ld((x), (d), (rnd)) ) 8954a238c70SJohn Marino #define mpfr_init_set_z(x, i, rnd) \ 8964a238c70SJohn Marino ( mpfr_init(x), mpfr_set_z((x), (i), (rnd)) ) 8974a238c70SJohn Marino #define mpfr_init_set_q(x, i, rnd) \ 8984a238c70SJohn Marino ( mpfr_init(x), mpfr_set_q((x), (i), (rnd)) ) 8994a238c70SJohn Marino #define mpfr_init_set(x, y, rnd) \ 9004a238c70SJohn Marino ( mpfr_init(x), mpfr_set((x), (y), (rnd)) ) 9014a238c70SJohn Marino #define mpfr_init_set_f(x, y, rnd) \ 9024a238c70SJohn Marino ( mpfr_init(x), mpfr_set_f((x), (y), (rnd)) ) 9034a238c70SJohn Marino 9044a238c70SJohn Marino /* Compatibility layer -- obsolete functions and macros */ 9054a238c70SJohn Marino /* Note: it is not possible to output warnings, unless one defines 9064a238c70SJohn Marino * a deprecated variable and uses it, e.g. 9074a238c70SJohn Marino * MPFR_DEPRECATED extern int mpfr_deprecated_feature; 9084a238c70SJohn Marino * #define MPFR_EMIN_MIN ((void)mpfr_deprecated_feature,mpfr_get_emin_min()) 9094a238c70SJohn Marino * (the cast to void avoids a warning because the left-hand operand 9104a238c70SJohn Marino * has no effect). 9114a238c70SJohn Marino */ 9124a238c70SJohn Marino #define mpfr_cmp_abs mpfr_cmpabs 9134a238c70SJohn Marino #define mpfr_round_prec(x,r,p) mpfr_prec_round(x,p,r) 9144a238c70SJohn Marino #define __gmp_default_rounding_mode (mpfr_get_default_rounding_mode()) 9154a238c70SJohn Marino #define __mpfr_emin (mpfr_get_emin()) 9164a238c70SJohn Marino #define __mpfr_emax (mpfr_get_emax()) 9174a238c70SJohn Marino #define __mpfr_default_fp_bit_precision (mpfr_get_default_fp_bit_precision()) 9184a238c70SJohn Marino #define MPFR_EMIN_MIN mpfr_get_emin_min() 9194a238c70SJohn Marino #define MPFR_EMIN_MAX mpfr_get_emin_max() 9204a238c70SJohn Marino #define MPFR_EMAX_MIN mpfr_get_emax_min() 9214a238c70SJohn Marino #define MPFR_EMAX_MAX mpfr_get_emax_max() 9224a238c70SJohn Marino #define mpfr_version (mpfr_get_version()) 9234a238c70SJohn Marino #ifndef mpz_set_fr 9244a238c70SJohn Marino # define mpz_set_fr mpfr_get_z 9254a238c70SJohn Marino #endif 9264a238c70SJohn Marino #define mpfr_add_one_ulp(x,r) \ 9274a238c70SJohn Marino (mpfr_sgn (x) > 0 ? mpfr_nextabove (x) : mpfr_nextbelow (x)) 9284a238c70SJohn Marino #define mpfr_sub_one_ulp(x,r) \ 9294a238c70SJohn Marino (mpfr_sgn (x) > 0 ? mpfr_nextbelow (x) : mpfr_nextabove (x)) 9304a238c70SJohn Marino #define mpfr_get_z_exp mpfr_get_z_2exp 9314a238c70SJohn Marino #define mpfr_custom_get_mantissa mpfr_custom_get_significand 9324a238c70SJohn Marino 9334a238c70SJohn Marino #endif /* __MPFR_H */ 9344a238c70SJohn Marino 9354a238c70SJohn Marino 9364a238c70SJohn Marino /* Check if <stdint.h> / <inttypes.h> is included or if the user 9374a238c70SJohn Marino explicitly wants intmax_t. Automatical detection is done by 9384a238c70SJohn Marino checking: 9394a238c70SJohn Marino - INTMAX_C and UINTMAX_C, but not if the compiler is a C++ one 9404a238c70SJohn Marino (as suggested by Patrick Pelissier) because the test does not 9414a238c70SJohn Marino work well in this case. See: 942*ab6d115fSJohn Marino https://sympa.inria.fr/sympa/arc/mpfr/2010-02/msg00025.html 9434a238c70SJohn Marino We do not check INTMAX_MAX and UINTMAX_MAX because under Solaris, 9444a238c70SJohn Marino these macros are always defined by <limits.h> (i.e. even when 9454a238c70SJohn Marino <stdint.h> and <inttypes.h> are not included). 9464a238c70SJohn Marino - _STDINT_H (defined by the glibc), _STDINT_H_ (defined under 9474a238c70SJohn Marino Mac OS X) and _STDINT (defined under MS Visual Studio), but 9484a238c70SJohn Marino this test may not work with all implementations. 9494a238c70SJohn Marino Portable software should not rely on these tests. 9504a238c70SJohn Marino */ 9514a238c70SJohn Marino #if (defined (INTMAX_C) && defined (UINTMAX_C) && !defined(__cplusplus)) || \ 9524a238c70SJohn Marino defined (MPFR_USE_INTMAX_T) || \ 9534a238c70SJohn Marino defined (_STDINT_H) || defined (_STDINT_H_) || defined (_STDINT) 9544a238c70SJohn Marino # ifndef _MPFR_H_HAVE_INTMAX_T 9554a238c70SJohn Marino # define _MPFR_H_HAVE_INTMAX_T 1 9564a238c70SJohn Marino 9574a238c70SJohn Marino #if defined (__cplusplus) 9584a238c70SJohn Marino extern "C" { 9594a238c70SJohn Marino #endif 9604a238c70SJohn Marino 9614a238c70SJohn Marino #define mpfr_set_sj __gmpfr_set_sj 9624a238c70SJohn Marino #define mpfr_set_sj_2exp __gmpfr_set_sj_2exp 9634a238c70SJohn Marino #define mpfr_set_uj __gmpfr_set_uj 9644a238c70SJohn Marino #define mpfr_set_uj_2exp __gmpfr_set_uj_2exp 9654a238c70SJohn Marino #define mpfr_get_sj __gmpfr_mpfr_get_sj 9664a238c70SJohn Marino #define mpfr_get_uj __gmpfr_mpfr_get_uj 9674a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_set_sj _MPFR_PROTO ((mpfr_t, intmax_t, mpfr_rnd_t)); 9684a238c70SJohn Marino __MPFR_DECLSPEC int 9694a238c70SJohn Marino mpfr_set_sj_2exp _MPFR_PROTO ((mpfr_t, intmax_t, intmax_t, mpfr_rnd_t)); 9704a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_set_uj _MPFR_PROTO ((mpfr_t, uintmax_t, mpfr_rnd_t)); 9714a238c70SJohn Marino __MPFR_DECLSPEC int 9724a238c70SJohn Marino mpfr_set_uj_2exp _MPFR_PROTO ((mpfr_t, uintmax_t, intmax_t, mpfr_rnd_t)); 9734a238c70SJohn Marino __MPFR_DECLSPEC intmax_t mpfr_get_sj _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t)); 9744a238c70SJohn Marino __MPFR_DECLSPEC uintmax_t mpfr_get_uj _MPFR_PROTO ((mpfr_srcptr, mpfr_rnd_t)); 9754a238c70SJohn Marino 9764a238c70SJohn Marino #if defined (__cplusplus) 9774a238c70SJohn Marino } 9784a238c70SJohn Marino #endif 9794a238c70SJohn Marino 9804a238c70SJohn Marino # endif /* _MPFR_H_HAVE_INTMAX_T */ 9814a238c70SJohn Marino #endif 9824a238c70SJohn Marino 9834a238c70SJohn Marino 9844a238c70SJohn Marino /* Check if <stdio.h> has been included or if the user wants FILE */ 9854a238c70SJohn Marino #if defined (_GMP_H_HAVE_FILE) || defined (MPFR_USE_FILE) 9864a238c70SJohn Marino # ifndef _MPFR_H_HAVE_FILE 9874a238c70SJohn Marino # define _MPFR_H_HAVE_FILE 1 9884a238c70SJohn Marino 9894a238c70SJohn Marino #if defined (__cplusplus) 9904a238c70SJohn Marino extern "C" { 9914a238c70SJohn Marino #endif 9924a238c70SJohn Marino 9934a238c70SJohn Marino #define mpfr_inp_str __gmpfr_inp_str 9944a238c70SJohn Marino #define mpfr_out_str __gmpfr_out_str 9954a238c70SJohn Marino __MPFR_DECLSPEC size_t mpfr_inp_str _MPFR_PROTO ((mpfr_ptr, FILE*, int, 9964a238c70SJohn Marino mpfr_rnd_t)); 9974a238c70SJohn Marino __MPFR_DECLSPEC size_t mpfr_out_str _MPFR_PROTO ((FILE*, int, size_t, 9984a238c70SJohn Marino mpfr_srcptr, mpfr_rnd_t)); 9994a238c70SJohn Marino #define mpfr_fprintf __gmpfr_fprintf 10004a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_fprintf _MPFR_PROTO ((FILE*, __gmp_const char*, 10014a238c70SJohn Marino ...)); 10024a238c70SJohn Marino 10034a238c70SJohn Marino #if defined (__cplusplus) 10044a238c70SJohn Marino } 10054a238c70SJohn Marino #endif 10064a238c70SJohn Marino 10074a238c70SJohn Marino # endif /* _MPFR_H_HAVE_FILE */ 10084a238c70SJohn Marino #endif 10094a238c70SJohn Marino 10104a238c70SJohn Marino 10114a238c70SJohn Marino /* check if <stdarg.h> has been included or if the user wants va_list */ 10124a238c70SJohn Marino #if defined (_GMP_H_HAVE_VA_LIST) || defined (MPFR_USE_VA_LIST) 10134a238c70SJohn Marino # ifndef _MPFR_H_HAVE_VA_LIST 10144a238c70SJohn Marino # define _MPFR_H_HAVE_VA_LIST 1 10154a238c70SJohn Marino 10164a238c70SJohn Marino #if defined (__cplusplus) 10174a238c70SJohn Marino extern "C" { 10184a238c70SJohn Marino #endif 10194a238c70SJohn Marino 10204a238c70SJohn Marino #define mpfr_vprintf __gmpfr_vprintf 10214a238c70SJohn Marino #define mpfr_vasprintf __gmpfr_vasprintf 10224a238c70SJohn Marino #define mpfr_vsprintf __gmpfr_vsprintf 10234a238c70SJohn Marino #define mpfr_vsnprintf __gmpfr_vsnprintf 10244a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_vprintf _MPFR_PROTO ((__gmp_const char*, va_list)); 10254a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_vasprintf _MPFR_PROTO ((char**, __gmp_const char*, 10264a238c70SJohn Marino va_list)); 10274a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_vsprintf _MPFR_PROTO ((char*, __gmp_const char*, 10284a238c70SJohn Marino va_list)); 10294a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_vsnprintf _MPFR_PROTO ((char*, size_t, 10304a238c70SJohn Marino __gmp_const char*, va_list)); 10314a238c70SJohn Marino 10324a238c70SJohn Marino #if defined (__cplusplus) 10334a238c70SJohn Marino } 10344a238c70SJohn Marino #endif 10354a238c70SJohn Marino 10364a238c70SJohn Marino # endif /* _MPFR_H_HAVE_VA_LIST */ 10374a238c70SJohn Marino #endif 10384a238c70SJohn Marino 10394a238c70SJohn Marino 10404a238c70SJohn Marino /* check if <stdarg.h> has been included and if FILE is available 10414a238c70SJohn Marino (see above) */ 10424a238c70SJohn Marino #if defined (_MPFR_H_HAVE_VA_LIST) && defined (_MPFR_H_HAVE_FILE) 10434a238c70SJohn Marino # ifndef _MPFR_H_HAVE_VA_LIST_FILE 10444a238c70SJohn Marino # define _MPFR_H_HAVE_VA_LIST_FILE 1 10454a238c70SJohn Marino 10464a238c70SJohn Marino #if defined (__cplusplus) 10474a238c70SJohn Marino extern "C" { 10484a238c70SJohn Marino #endif 10494a238c70SJohn Marino 10504a238c70SJohn Marino #define mpfr_vfprintf __gmpfr_vfprintf 10514a238c70SJohn Marino __MPFR_DECLSPEC int mpfr_vfprintf _MPFR_PROTO ((FILE*, __gmp_const char*, 10524a238c70SJohn Marino va_list)); 10534a238c70SJohn Marino 10544a238c70SJohn Marino #if defined (__cplusplus) 10554a238c70SJohn Marino } 10564a238c70SJohn Marino #endif 10574a238c70SJohn Marino 10584a238c70SJohn Marino # endif /* _MPFR_H_HAVE_VA_LIST_FILE */ 10594a238c70SJohn Marino #endif 1060