On 29 aug, 18:43, John H Palmieri <jhpalmier...@gmail.com> wrote: > On Aug 29, 8:51 am, Simon King <simon.k...@nuigalway.ie> wrote: > > > Note that expon uses Maxima, because you use the logarithm. So, I > > reckon that your problem is related > > withhttp://trac.sagemath.org/sage_trac/ticket/4731 > > andhttp://trac.sagemath.org/sage_trac/ticket/6818. > > If not, you might try to work around by thinking what "expon" really > > does. For example, one of my first problems with Sage occurred when I > > used the logarithm for determining the number of digits of a natural > > number n -- len(str(n)) is much faster! > > Or you can use "math.log" instead of "log" -- this should use the > Python log function rather than the Maxima one: use > > def expon(mx,g): return floor(math.log(mx)/math.log(g))+1 > > John
Hi, The whole issue boils down to: floor(log(256)/log(2))+1 which takes 'ages' to compute (Sage 4.1). print floor(ln(256)/ln(2))+1 is no improvement; floor(math.log(mx)/ math.log(g))+1 is. Rolandb --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---