-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Fair enough. One could try to modify mpz_sizeinbase to accept larger bases, although I'm not sure how easy it would be to make it work with *arbitrary* bases. Anyway, this is a bit more involved than what I'm willing to try now. It's definitely something worth investigating though.
Since we do have a better option for bases <= 256, I've put this code in at the start of exact_log, and ndigits now just wraps exact_log. I've left the rest of the code in exact_log the way it was before, except for a trivial change that sometimes pays off big time: changing m**guess to Integer(m)**guess. # with m**guess: sage: n=10000000000000**1000000+1 sage: time n.exact_log(234) CPU times: user 146.33 s, sys: 0.13 s, total: 146.46 s Wall time: 146.50 5487047 # with Integer(m)**guess sage: n=10000000000000**1000000+1 sage: time n.exact_log(234) CPU times: user 2.04 s, sys: 0.02 s, total: 2.06 s Wall time: 2.06 5487047 I've put a new patch on sagetrac under #1014. Best, Alex David Harvey wrote: > > That would be okay, as long as you address the issue Carl brings up > in a subsequent email regarding the maximum base being 256; exact_log > is used in a few places in the p-adics code, where we might encounter > a larger base. Unfortunately I don't think there are any doctests yet > to cover the large base case. > > To be honest, my preference would be to put the guts of the > implementation in exact_log, and get ndigits to call exact_log. My > feeling is that "logarithm" is closer to the real mathematical > meaning we're after, and "number of digits" is an application. But > this is open to debate. > > david > > > > > - -- Alexandru Ghitza Assistant Professor Department of Mathematics Colby College Waterville, ME 04901 http://bayes.colby.edu/~ghitza/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHnqk9dZTaNFFPILgRAtq2AKCZcA/DZx3zH0tyBb3LWhpFRTrIkACeJI7r w1N8ffSPOrLkwc9bX5VXjZY= =TKsK -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---