summaryrefslogtreecommitdiff
path: root/set_ld.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-10-06 13:32:02 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2003-10-06 13:32:02 +0000
commita4edd55ee807582df536738f29ef0caeb7965ece (patch)
treefe7d43b776f81e3516df9adba6f1944b28d47256 /set_ld.c
parentee21821c19f67fc31462fa73a00fb83198d8e4e7 (diff)
downloadmpfr-a4edd55ee807582df536738f29ef0caeb7965ece.tar.gz
use macros to avoid possible problem with float input
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2476 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'set_ld.c')
-rw-r--r--set_ld.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/set_ld.c b/set_ld.c
index 91a777931..055be494d 100644
--- a/set_ld.c
+++ b/set_ld.c
@@ -78,7 +78,10 @@ mpfr_set_ld (mpfr_ptr r, long double d, mp_rnd_t rnd_mode)
{
long double div9, div10, div11, div12, div13;
- div9 = (long double) (double) 1.34078079299425971e154; /* 2^(2^9) */
+#define TWO_64 18446744073709551616.0 /* 2^64 */
+#define TWO_128 (TWO_64 * TWO_64)
+#define TWO_256 (TWO_128 * TWO_128)
+ div9 = (long double) (double) (TWO_256 * TWO_256); /* 2^(2^9) */
div10 = div9 * div9;
div11 = div10 * div10; /* 2^(2^11) */
div12 = div11 * div11; /* 2^(2^12) */