diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-11-19 12:39:10 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-11-19 12:39:10 +0000 |
commit | 38c77249c6671159c0c7e40a73f1f5a3bc76dc8e (patch) | |
tree | fd12f35cf4b230dfcccf5eaf65a216f3ba0cdca7 /ufloor_log2.c | |
parent | 68d7536264604dfa93c6540d11fd292e6e14e3ff (diff) | |
download | mpfr-38c77249c6671159c0c7e40a73f1f5a3bc76dc8e.tar.gz |
Improve coverage tests.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3107 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'ufloor_log2.c')
-rw-r--r-- | ufloor_log2.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/ufloor_log2.c b/ufloor_log2.c index fe901dfd5..fc3876555 100644 --- a/ufloor_log2.c +++ b/ufloor_log2.c @@ -21,7 +21,7 @@ MA 02111-1307, USA. */ #include "mpfr-impl.h" -/* returns floor(log(abs(d))/log(2)) */ +/* returns floor(log2(d)) */ long __gmpfr_floor_log2 (double d) { @@ -34,13 +34,8 @@ __gmpfr_floor_log2 (double d) long exp; double m; - /* Get Abs */ - if (d < 0.0) - d = -d; - - if (d == 0.0) - return -1023; - else if (d >= 1.0) + MPFR_ASSERTD (d >= 0); + if (d >= 1.0) { exp = -1; for( m= 1.0 ; m <= d ; m *=2.0 ) |