On Dec 4, 2007 11:02 AM, Stephen Forrest <[EMAIL PROTECTED]> wrote: > > On Dec 4, 2007 1:57 PM, Robert Bradshaw <[EMAIL PROTECTED]> wrote: > > [snip] > > Perhaps the exact_log function of Integer might help (though it > > rounds down)? > > > > sage: a = 17 > > sage: a.exact_log(2) > > 4 > > Thanks very much; even though I made the original post in confusion, I > had been wondering how to do this in Sage. I had expected to find > would be a top-level command for it. > > I'll revise the list of number-theoretic functions I posted last week > to include exact_log as a Sage analogue of Maple's ilog.
There is also a very fast command "bits" that might be useful for the above example: sage: a = 17 sage: a.bits() 5 Thanks for the idea to have an "exact_log" as a top-level function. Thought through it sounds like a really good idea. william --~--~---------~--~----~------------~-------~--~----~ 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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---