diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-06-22 11:42:30 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2018-06-22 11:42:30 +0000 |
commit | 15673bca5bc170741b6bb35dcbb950a1dfead800 (patch) | |
tree | 4aca9da772b95bbe9a9fe88386054bfcf71af1da | |
parent | 68af9eed1800641ff5bd63dbf34d26d2f9746535 (diff) | |
download | mpfr-15673bca5bc170741b6bb35dcbb950a1dfead800.tar.gz |
[src/set_d64.c] Code improvement (like r12809 and r12828 in set_d128.c).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12832 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | src/set_d64.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/set_d64.c b/src/set_d64.c index 71fd191da..85b493d4a 100644 --- a/src/set_d64.c +++ b/src/set_d64.c @@ -119,11 +119,12 @@ decimal64_to_string (char *s, _Decimal64 d) char *t; unsigned int Gh; /* most 5 significant bits from combination field */ int exp; /* exponent */ - mp_limb_t rp[2]; - mp_size_t rn = 2; unsigned int i; #ifdef DPD_FORMAT unsigned int d0, d1, d2, d3, d4, d5; +#else + mp_limb_t rp[2]; + mp_size_t rn; #endif /* now convert BID or DPD to string */ @@ -198,9 +199,11 @@ decimal64_to_string (char *s, _Decimal64 d) rp[1] &= 524287; /* 2^19-1: cancel G[11] */ rp[1] |= 2097152; /* add 2^21 */ } -#if GMP_NUMB_BITS >= 54 +#if GMP_NUMB_BITS >= 64 rp[0] |= rp[1] << 32; rn = 1; +#else + rn = 2; #endif while (rn > 0 && rp[rn - 1] == 0) rn --; |