summaryrefslogtreecommitdiff
path: root/log2.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-08-18 16:35:19 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-08-18 16:35:19 +0000
commitbab5aab404897a12fe1c87734ebf2aa270b9b73b (patch)
tree73ab96f558e7e0b4ef371902ead983189184a0f7 /log2.c
parent8328a51518450ad8ddb86e38e7952e28065ff22a (diff)
downloadmpfr-bab5aab404897a12fe1c87734ebf2aa270b9b73b.tar.gz
Converted tabs to spaces with expand.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3725 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'log2.c')
-rw-r--r--log2.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/log2.c b/log2.c
index f31b2e44e..efcd61ffc 100644
--- a/log2.c
+++ b/log2.c
@@ -35,33 +35,33 @@ mpfr_log2 (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode)
{
/* If a is NaN, the result is NaN */
if (MPFR_IS_NAN (a))
- {
- MPFR_SET_NAN (r);
- MPFR_RET_NAN;
- }
+ {
+ MPFR_SET_NAN (r);
+ MPFR_RET_NAN;
+ }
/* check for infinity before zero */
else if (MPFR_IS_INF (a))
- {
- if (MPFR_IS_NEG (a))
- /* log(-Inf) = NaN */
- {
- MPFR_SET_NAN (r);
- MPFR_RET_NAN;
- }
- else /* log(+Inf) = +Inf */
- {
- MPFR_SET_INF (r);
- MPFR_SET_POS (r);
- MPFR_RET (0);
- }
- }
+ {
+ if (MPFR_IS_NEG (a))
+ /* log(-Inf) = NaN */
+ {
+ MPFR_SET_NAN (r);
+ MPFR_RET_NAN;
+ }
+ else /* log(+Inf) = +Inf */
+ {
+ MPFR_SET_INF (r);
+ MPFR_SET_POS (r);
+ MPFR_RET (0);
+ }
+ }
else /* a is zero */
- {
+ {
MPFR_ASSERTD (MPFR_IS_ZERO (a));
- MPFR_SET_INF (r);
- MPFR_SET_NEG (r);
- MPFR_RET (0); /* log2(0) is an exact -infinity */
- }
+ MPFR_SET_INF (r);
+ MPFR_SET_NEG (r);
+ MPFR_RET (0); /* log2(0) is an exact -infinity */
+ }
}
/* If a is negative, the result is NaN */
@@ -99,7 +99,7 @@ mpfr_log2 (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode)
/* the optimal number of bits : see algorithms.tex */
Nt = Ny + 3 + MPFR_INT_CEIL_LOG2 (Ny);
- /* initialise of intermediary variable */
+ /* initialise of intermediary variable */
mpfr_init2 (t, Nt);
mpfr_init2 (tt, Nt);
@@ -111,14 +111,14 @@ mpfr_log2 (mpfr_ptr r, mpfr_srcptr a, mp_rnd_t rnd_mode)
mpfr_const_log2(t,GMP_RNDD); /* log(2) */
mpfr_log(tt,a,GMP_RNDN); /* log(a) */
mpfr_div(t,tt,t,GMP_RNDN); /* log(a)/log(2) */
-
+
/* estimation of the error */
err = Nt-3;
- if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
- break;
-
+ if (MPFR_LIKELY (MPFR_CAN_ROUND (t, err, Ny, rnd_mode)))
+ break;
+
/* actualisation of the precision */
- MPFR_ZIV_NEXT (loop, Nt);
+ MPFR_ZIV_NEXT (loop, Nt);
mpfr_set_prec (t, Nt);
mpfr_set_prec (tt, Nt);
}