summaryrefslogtreecommitdiff
path: root/frac.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-08-07 21:17:14 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-08-07 21:17:14 +0000
commit5fd7ef6fae3a729815a73949c1a70224d913ae4c (patch)
tree7fe4c36956a8d313abdc6658da4f1e30a71a21ae /frac.c
parentc2d7168d28d71bd8f6c75a19f97d5b23e7dc821d (diff)
downloadmpfr-5fd7ef6fae3a729815a73949c1a70224d913ae4c.tar.gz
Further code clean-up (and consistency) based on icc warnings:
* Removed useless code. * Avoid hiding variable declarations. * Use #ifdef BOOL_MACRO instead of #if BOOL_MACRO. * In MPFR_RNDRAW_GEN macro definition, variables declared locally now start with an underscore to avoid possible conflits with parameters (and modified macro calls that use these variables). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5492 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'frac.c')
-rw-r--r--frac.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/frac.c b/frac.c
index 77687bb6b..6d6e83077 100644
--- a/frac.c
+++ b/frac.c
@@ -31,7 +31,7 @@ int
mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode)
{
mp_exp_t re, ue;
- mp_prec_t uq, fq;
+ mp_prec_t uq;
mp_size_t un, tn, t0;
mp_limb_t *up, *tp, k;
int sh;
@@ -92,12 +92,7 @@ mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mp_rnd_t rnd_mode)
/* The exponent of r will be re */
/* un: index of the limb of u that contains the first bit 1 of the FP */
- ue -= re; /* number of bits of u to discard */
- fq = uq - ue; /* number of bits of the fractional part of u */
-
- /* Temporary fix */
- t = /* fq > MPFR_PREC(r) */
- (mp_size_t) (MPFR_PREC(r) - 1) / BITS_PER_MP_LIMB < un ?
+ t = (mp_size_t) (MPFR_PREC(r) - 1) / BITS_PER_MP_LIMB < un ?
(mpfr_init2 (tmp, (un + 1) * BITS_PER_MP_LIMB), tmp) : r;
/* t has enough precision to contain the fractional part of u */
/* If we use a temporary variable, we take the non-significant bits