On Jan 28, 2008, at 6:47 PM, Alex Ghitza wrote:
> OK, I'm quite happy with this (thanks David for suggesting it > and Carl for telling me how to do it!) > > I've put this in and played around with it. It is definitely > *much* faster for the huge examples that I tried, and it's > also fast enough on smaller numbers. > > I'll post a new patch for #1014 shortly. David, is it ok if I > replace the current exact_log() function with > > return self.ndigits(m) - 1 > > (after checking self is positive, etc.)? 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 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---