summaryrefslogtreecommitdiff
path: root/div_ui.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-10-31 12:08:13 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2005-10-31 12:08:13 +0000
commit526a5ebad30c5be681eee1904991d1300d7f4635 (patch)
tree2e36dd714c323f30d71ac73770b48febaf5cdd6a /div_ui.c
parent385dd2a5145031a48b33efbfc6b389cd889eb911 (diff)
downloadmpfr-526a5ebad30c5be681eee1904991d1300d7f4635.tar.gz
Fixed MPFR_INT_CEIL_LOG2 (in mpfr-impl.h) and __gmpfr_int_ceil_log2
(in int_ceil_log2.c) when the argument is a power of 2, and added a test (new test file tests/tinternals.c). This made a bug appear in div_ui.c and mul_ui.c; fixed that too. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3914 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'div_ui.c')
-rw-r--r--div_ui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/div_ui.c b/div_ui.c
index 705c2d3db..fda59e8d7 100644
--- a/div_ui.c
+++ b/div_ui.c
@@ -77,7 +77,7 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mp_rnd_t rnd_mode)
return mpfr_set (y, x, rnd_mode);
}
else if (MPFR_UNLIKELY (IS_POW2 (u)))
- return mpfr_div_2si (y, x, MPFR_INT_CEIL_LOG2 (u)-1, rnd_mode);
+ return mpfr_div_2si (y, x, MPFR_INT_CEIL_LOG2 (u), rnd_mode);
MPFR_CLEAR_FLAGS (y);