diff options
author | Kevin Ryde <user42@zip.com.au> | 2001-11-07 22:57:52 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2001-11-07 22:57:52 +0100 |
commit | 8979cb56a5b7844a043e2d79e592e069fdcdfd72 (patch) | |
tree | d377d02f787907f9538ae122b514db89b5680e94 /mpf | |
parent | ee03e1899ff0af936d5b6db67e9b3725aad73c19 (diff) | |
download | gmp-8979cb56a5b7844a043e2d79e592e069fdcdfd72.tar.gz |
* gmp-h.in, gmp-impl.h, mpf/abs.c, mpf/neg.c, mpf/get_prc.c,
mpf/get_dfl_prec.c, mpf/set_dfl_prec.c, mpf/set_prc_raw.c,
mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Revert mpf inlining, in order
to leave open the possibility of keeping binary compatibility if mpf
becomes mpfr.
Diffstat (limited to 'mpf')
-rw-r--r-- | mpf/abs.c | 2 | ||||
-rw-r--r-- | mpf/get_dfl_prec.c | 9 | ||||
-rw-r--r-- | mpf/get_prc.c | 8 | ||||
-rw-r--r-- | mpf/neg.c | 2 | ||||
-rw-r--r-- | mpf/set_dfl_prec.c | 8 | ||||
-rw-r--r-- | mpf/set_prc_raw.c | 8 | ||||
-rw-r--r-- | mpf/set_si.c | 10 | ||||
-rw-r--r-- | mpf/set_ui.c | 9 | ||||
-rw-r--r-- | mpf/size.c | 8 |
9 files changed, 46 insertions, 18 deletions
@@ -19,8 +19,6 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define __GMP_FORCE_mpf_abs 1 - #include "gmp.h" #include "gmp-impl.h" diff --git a/mpf/get_dfl_prec.c b/mpf/get_dfl_prec.c index 6be2e126b..36eea7d86 100644 --- a/mpf/get_dfl_prec.c +++ b/mpf/get_dfl_prec.c @@ -19,7 +19,12 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define __GMP_FORCE_mpf_get_default_prec 1 - #include "gmp.h" #include "gmp-impl.h" + + +unsigned long +mpf_get_default_prec (void) +{ + return __GMPF_PREC_TO_BITS (__gmp_default_fp_limb_precision); +} diff --git a/mpf/get_prc.c b/mpf/get_prc.c index a26526b57..f1391c675 100644 --- a/mpf/get_prc.c +++ b/mpf/get_prc.c @@ -19,7 +19,11 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define __GMP_FORCE_mpf_get_prec 1 - #include "gmp.h" #include "gmp-impl.h" + +unsigned long int +mpf_get_prec (mpf_srcptr x) +{ + return __GMPF_PREC_TO_BITS (x->_mp_prec); +} @@ -19,8 +19,6 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define __GMP_FORCE_mpf_neg 1 - #include "gmp.h" #include "gmp-impl.h" diff --git a/mpf/set_dfl_prec.c b/mpf/set_dfl_prec.c index e5bae3bdf..77434efb6 100644 --- a/mpf/set_dfl_prec.c +++ b/mpf/set_dfl_prec.c @@ -19,9 +19,13 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define __GMP_FORCE_mpf_set_default_prec 1 - #include "gmp.h" #include "gmp-impl.h" mp_size_t __gmp_default_fp_limb_precision = __GMPF_BITS_TO_PREC (53); + +void +mpf_set_default_prec (unsigned long int prec_in_bits) +{ + __gmp_default_fp_limb_precision = __GMPF_BITS_TO_PREC (prec_in_bits); +} diff --git a/mpf/set_prc_raw.c b/mpf/set_prc_raw.c index a28a02f90..46774ff2a 100644 --- a/mpf/set_prc_raw.c +++ b/mpf/set_prc_raw.c @@ -21,7 +21,11 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define __GMP_FORCE_mpf_set_prec_raw 1 - #include "gmp.h" #include "gmp-impl.h" + +void +mpf_set_prec_raw (mpf_ptr x, unsigned long int prec_in_bits) +{ + x->_mp_prec = __GMPF_BITS_TO_PREC (prec_in_bits); +} diff --git a/mpf/set_si.c b/mpf/set_si.c index fe8b70b57..020d647ac 100644 --- a/mpf/set_si.c +++ b/mpf/set_si.c @@ -19,7 +19,13 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define __GMP_FORCE_mpf_set_si 1 - #include "gmp.h" #include "gmp-impl.h" + +void +mpf_set_si (mpf_ptr f, long n) +{ + f->_mp_d[0] = (unsigned long) (n >= 0 ? n : -n); + f->_mp_exp = (n != 0); + f->_mp_size = (n < 0 ? -1 : n != 0); +} diff --git a/mpf/set_ui.c b/mpf/set_ui.c index c1f077c77..8f10bd9b1 100644 --- a/mpf/set_ui.c +++ b/mpf/set_ui.c @@ -19,7 +19,12 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define __GMP_FORCE_mpf_set_ui 1 - #include "gmp.h" #include "gmp-impl.h" + +void +mpf_set_ui (mpf_ptr f, unsigned long n) +{ + f->_mp_d[0] = n; + f->_mp_exp = f->_mp_size = (n != 0); +} diff --git a/mpf/size.c b/mpf/size.c index ab9ecaffd..d9cb66be3 100644 --- a/mpf/size.c +++ b/mpf/size.c @@ -20,7 +20,11 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define __GMP_FORCE_mpf_size 1 - #include "gmp.h" #include "gmp-impl.h" + +size_t +mpf_size (mpf_srcptr f) +{ + return __GMP_ABS (f->_mp_size); +} |