summaryrefslogtreecommitdiff
path: root/set_ld.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-06-26 13:40:08 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-06-26 13:40:08 +0000
commit3bd252817f1048db139cc3e1a34e850f7b67abdd (patch)
tree4514fed625fe252e786378cddfac6d7405507e93 /set_ld.c
parente81472a1d9c12d70c474f2fe93c5020e412ec993 (diff)
downloadmpfr-3bd252817f1048db139cc3e1a34e850f7b67abdd.tar.gz
moved macros for [L]DBL_MANT_DIG in mpfr-impl.h
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2373 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'set_ld.c')
-rw-r--r--set_ld.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/set_ld.c b/set_ld.c
index 52954588a..3aaa8dc72 100644
--- a/set_ld.c
+++ b/set_ld.c
@@ -21,22 +21,12 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
#include <float.h>
-#include <limits.h> /* for CHAR_BIT */
#include "gmp.h"
#include "gmp-impl.h"
#include "mpfr.h"
#include "mpfr-impl.h"
-#ifndef DBL_MANT_DIG
-#define DBL_MANT_DIG 53
-#endif
-
-#ifndef CHAR_BIT
-#define CHAR_BIT 8
-#endif
-
-
/* Various i386 systems have been seen with float.h LDBL constants equal to
the DBL ones, whereas they ought to be bigger, reflecting the 10-byte
IEEE extended format on that processor. gcc 3.2.1 on FreeBSD and Solaris
@@ -56,11 +46,6 @@ static const struct {
#define MPFR_LDBL_MAX LDBL_MAX
#endif
-/* This is an overestimate, but fine for our purposes, it only needs to be
- enough that "t" below can hold a long double without rounding. */
-#define MPFR_LDBL_MANT_DIG (CHAR_BIT * sizeof (long double))
-
-
int
mpfr_set_ld (mpfr_ptr r, long double d, mp_rnd_t rnd_mode)
{
@@ -85,7 +70,7 @@ mpfr_set_ld (mpfr_ptr r, long double d, mp_rnd_t rnd_mode)
return mpfr_set_d (r, (double) d, rnd_mode);
mpfr_init2 (t, MPFR_LDBL_MANT_DIG);
- mpfr_init2 (u, DBL_MANT_DIG);
+ mpfr_init2 (u, IEEE_DBL_MANT_DIG);
mpfr_set_ui (t, 0, GMP_RNDN);
while (d != 0.0)
{