[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323
Bernhard R. Link
brlink at debian.org
Tue Apr 24 15:55:32 UTC 2012
The following commit has been merged in the cleanedupstream branch:
commit f76aaf569b67d75528b5fa5e41b72cdf22493b93
Author: Martin Lee <martinlee84 at web.de>
Date: Wed Apr 4 12:11:29 2012 +0200
fix: bug in ilog2
diff --git a/factory/canonicalform.cc b/factory/canonicalform.cc
index 41e5fb5..bfd752d 100644
--- a/factory/canonicalform.cc
+++ b/factory/canonicalform.cc
@@ -1315,7 +1315,13 @@ CanonicalForm::ilog2 () const
ASSERT( is_imm( value ) == INTMARK, "ilog2() not implemented" );
int a = imm2int( value );
ASSERT( a > 0, "arg to ilog2() less or equal zero" );
- return ::ilog2(a);
+ int n = -1;
+ while ( a > 0 )
+ {
+ n++;
+ a /=2;
+ }
+ return n;
}
else
return value->ilog2();
--
an open source computer algebra system
More information about the debian-science-commits
mailing list