Am Freitag, den 23.12.2011, 09:59 -0500 schrieb Stavros Macrakis:
> Seems like bad documentation.
>
>
> exp_of is apparently looking for the *highest power* of m in k, e.g.
>
>
> (%i13) makelist(exp_of(i,2),i,1,20);
> (%o13)
> [false,1,false,2,false,1,false,3,false,1,false,2,false,1,false,4,false,1,false,2]
> (%i14) makelist(exp_of(i,3),i,1,20);
> (%o14)
> [false,false,1,false,false,1,false,false,2,false,false,1,false,false,1,false,false,2,false,
> false]
> (%i15) makelist(exp_of(6^i,3),i,1,20);
> (%o15) [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
> (%i16) makelist(exp_of(6^i,2),i,1,20);
> (%o16) [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
> (%i17) genmatrix(lambda([i,j],2^i*3^j),5,5);
> (%o17)
> matrix([6,18,54,162,486],[12,36,108,324,972],[24,72,216,648,1944],[48,144,432,1296,3888],
> [96,288,864,2592,7776])
> (%i18) matrixmap(lambda([k],exp_of(k,2)),%o17);
> (%o18)
> matrix([1,1,1,1,1],[2,2,2,2,2],[3,3,3,3,3],[4,4,4,4,4],[5,5,5,5,5])
> (%i19) matrixmap(lambda([k],exp_of(k,3)),%o17);
> (%o19)
> matrix([1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5])
>
>
> On Fri, Dec 23, 2011 at 08:22, Barton Willis <willisb at unk.edu> wrote:
> exp_of(k,m) := ?exponent\-of(k,m)$
I have done the last change to the function exponent-of . I have not
changed the algorithm to find the exponent. I have simplified the
function exponent-of to the cases we need for the simplification of
products in timesin. The function exponent-of is only used in the
function timesin.
Because exponent-of is a core function within the simplifier, I think it
is useful to do no extra work which might slow down the simplification
of expressions.
I have found no problems with the implementation, but I will look again
into the algorithmus. Perhaps the documentation should be improved.
Dieter Kaiser