summaryrefslogtreecommitdiff
path: root/mpf
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-11-07 22:57:52 +0100
committerKevin Ryde <user42@zip.com.au>2001-11-07 22:57:52 +0100
commit8979cb56a5b7844a043e2d79e592e069fdcdfd72 (patch)
treed377d02f787907f9538ae122b514db89b5680e94 /mpf
parentee03e1899ff0af936d5b6db67e9b3725aad73c19 (diff)
downloadgmp-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.c2
-rw-r--r--mpf/get_dfl_prec.c9
-rw-r--r--mpf/get_prc.c8
-rw-r--r--mpf/neg.c2
-rw-r--r--mpf/set_dfl_prec.c8
-rw-r--r--mpf/set_prc_raw.c8
-rw-r--r--mpf/set_si.c10
-rw-r--r--mpf/set_ui.c9
-rw-r--r--mpf/size.c8
9 files changed, 46 insertions, 18 deletions
diff --git a/mpf/abs.c b/mpf/abs.c
index 69ea6b48d..7d6d65982 100644
--- a/mpf/abs.c
+++ b/mpf/abs.c
@@ -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);
+}
diff --git a/mpf/neg.c b/mpf/neg.c
index e02caec16..5e628e9bf 100644
--- a/mpf/neg.c
+++ b/mpf/neg.c
@@ -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);
+}