summaryrefslogtreecommitdiff
path: root/set_d.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-06 13:27:05 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-02-06 13:27:05 +0000
commit19767e6f6f9089ef12f81e9f3b64f5c71ff71c84 (patch)
tree388f8324eb4f2595b607ac0b1afa7352ca4c9c5d /set_d.c
parent6e0b309b6faf9353e1732c77a95099a5aa5d86c0 (diff)
downloadmpfr-19767e6f6f9089ef12f81e9f3b64f5c71ff71c84.tar.gz
+ Better support of non IEEE doubles.
+ You can compile MPFR without gmp internal files (ie gmp-impl.h, gmp-mparam.h, and config.h). You only need gmp.h and libgmp.a. But you can still compile with GMP internal files (configure detects them). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2665 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'set_d.c')
-rw-r--r--set_d.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/set_d.c b/set_d.c
index f3c928617..a5176730f 100644
--- a/set_d.c
+++ b/set_d.c
@@ -20,10 +20,9 @@ along with the MPFR 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. */
-#include "gmp.h"
-#include "gmp-impl.h"
-#include "longlong.h"
-#include "mpfr.h"
+#include <string.h> /* For memcmp if _GMP_IEEE_FLOAT == 0 */
+
+#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
#if (BITS_PER_MP_LIMB==32)
@@ -66,7 +65,7 @@ __mpfr_extract_double (mp_ptr rp, double d)
exp = x.s.exp;
if (exp)
{
-#if BITS_PER_MP_LIMB == 64
+#if BITS_PER_MP_LIMB >= 64
manl = ((MP_LIMB_T_ONE << 63)
| ((mp_limb_t) x.s.manh << 43) | ((mp_limb_t) x.s.manl << 11));
#else
@@ -76,7 +75,7 @@ __mpfr_extract_double (mp_ptr rp, double d)
}
else /* denormalized number */
{
-#if BITS_PER_MP_LIMB == 64
+#if BITS_PER_MP_LIMB >= 64
manl = ((mp_limb_t) x.s.manh << 43) | ((mp_limb_t) x.s.manl << 11);
#else
manh = (x.s.manh << 11) /* high 21 bits */
@@ -125,7 +124,7 @@ __mpfr_extract_double (mp_ptr rp, double d)
}
d *= MP_BASE_AS_DOUBLE;
-#if BITS_PER_MP_LIMB == 64
+#if BITS_PER_MP_LIMB >= 64
manl = d;
#else
manh = d;
@@ -135,7 +134,7 @@ __mpfr_extract_double (mp_ptr rp, double d)
#endif /* _GMP_IEEE_FLOATS */
-#if BITS_PER_MP_LIMB == 64
+#if BITS_PER_MP_LIMB >= 64
rp[0] = manl;
#else
rp[1] = manh;